|
@@ -19,13 +19,12 @@ export class P2pDatabaseGunProvider {
|
|
|
this.gun.get(userid).put({ lastTweet: hash });
|
|
|
}
|
|
|
|
|
|
- public getLastTweetFromUser(userid): string {
|
|
|
- let hash;
|
|
|
- this.gun
|
|
|
- .get(userid)
|
|
|
- .get("lastTweet")
|
|
|
- .once(lastTweet => (hash = lastTweet));
|
|
|
-
|
|
|
- return hash;
|
|
|
+ public async getLastTweetFromUser(userid) {
|
|
|
+ return new Promise(resolve =>
|
|
|
+ this.gun
|
|
|
+ .get(userid)
|
|
|
+ .get("lastTweet")
|
|
|
+ .once(resolve)
|
|
|
+ );
|
|
|
}
|
|
|
}
|