Browse Source

code clean up

rohit.gowda 4 years ago
parent
commit
0dd2005a94
1 changed files with 3 additions and 4 deletions
  1. 3 4
      app/src/pages/write-tweet/write-tweet.ts

+ 3 - 4
app/src/pages/write-tweet/write-tweet.ts

@@ -142,7 +142,6 @@ export class WriteTweetPage {
       ) {
         loading.setContent("Publish private tweet...");
         await this.tweetPrivate();
-
       } else {
         loading.dismiss();
         const alert = this.alertCtrl.create({
@@ -174,20 +173,20 @@ export class WriteTweetPage {
     //encrypt the tweet with multiple keys
     let encryptedTweet = await this.opnpgp.encrypt(JSON.stringify(tweet));
 
-    this.storeIPFS(encryptedTweet, tweet)
+    await this.storeIPFS(encryptedTweet, tweet)
     return encryptedTweet;
   }
 
   private async storeIPFS(result, tweet){
 
     const res = await this.ipfs.storeTweet(result);
-    this.gun.storeLastTweetHashForUser(
+    await this.gun.storeLastTweetHashForUser(
       tweet.user_id,
       res["Hash"],
       tweet.created_at
     );
 
-    this.gun.publishHashtags(tweet.entities.hashtags);
+    await this.gun.publishHashtags(tweet.entities.hashtags);
   }
 
   private async buildPrivateTweet() {