File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,30 @@ class Akun {
12
12
this . connection = new RealTimeConnection ( this , this . _settings . connection ) ;
13
13
}
14
14
// Special choice node in unpublished story devoted to divining the ephemeralUserId
15
- this . _ephemeralUserId = this . vote ( 'DAjqaif2XdtjF9mPD' , 0 ) . then ( ( { user } ) => user ) ;
15
+ this . _ephemeralUserId = null ;
16
+ this . _ephemeralUserIdPromise = this . vote ( 'DAjqaif2XdtjF9mPD' , 0 ) . then ( ( { user } ) => {
17
+ this . _ephemeralUserId = user ;
18
+ return user ;
19
+ } ) ;
16
20
this . _clients = new Map ( ) ;
17
21
}
18
22
19
23
/**
20
24
* Special UID based on IP used to track vote requests
21
25
*
26
+ * @returns {?string }
27
+ */
28
+ get ephemeralUserId ( ) {
29
+ return this . _ephemeralUserId ;
30
+ }
31
+
32
+ /**
33
+ * Promise that resolves to ephemeralUserId
34
+ *
22
35
* @returns {Promise<string> }
23
36
*/
24
37
get ephemeralUserIdPromise ( ) {
25
- return this . _ephemeralUserId ;
38
+ return this . _ephemeralUserIdPromise ;
26
39
}
27
40
28
41
get loggedIn ( ) {
You can’t perform that action at this time.
0 commit comments