Skip to content

Commit 5ebb900

Browse files
committed
Decided I wanted a non-async version afterall
1 parent 3f1d7db commit 5ebb900

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

js/Akun.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,30 @@ class Akun {
1212
this.connection = new RealTimeConnection(this, this._settings.connection);
1313
}
1414
// 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+
});
1620
this._clients = new Map();
1721
}
1822

1923
/**
2024
* Special UID based on IP used to track vote requests
2125
*
26+
* @returns {?string}
27+
*/
28+
get ephemeralUserId() {
29+
return this._ephemeralUserId;
30+
}
31+
32+
/**
33+
* Promise that resolves to ephemeralUserId
34+
*
2235
* @returns {Promise<string>}
2336
*/
2437
get ephemeralUserIdPromise() {
25-
return this._ephemeralUserId;
38+
return this._ephemeralUserIdPromise;
2639
}
2740

2841
get loggedIn() {

0 commit comments

Comments
 (0)