Browse Source

Work around to fix rate limit exceeded error

rohit.gowda 4 years ago
parent
commit
1c67e30baa

+ 5 - 5
app/src/pages/home/home.ts

@@ -19,6 +19,7 @@ import { FeedProvider } from "../../providers/feed/feed";
 export class HomePage {
   menuController: MenuController;
   tweets;
+  cachedTweets=[];
   privateTweet:boolean = false;
   public color = 'primary';
 
@@ -56,6 +57,7 @@ export class HomePage {
         this.alertCtrl.create(alertText).present()
       })
       .then(() => loading.dismiss());
+     
   }
 
   doRefresh(refresher: Refresher) {
@@ -83,6 +85,7 @@ export class HomePage {
   }
 
   get privateTweets() {
+    Object.assign(this.cachedTweets ,this.tweets);
     return this.tweets.filter(tweet => tweet.private_tweet);
   }
 
@@ -119,11 +122,8 @@ export class HomePage {
 
     else{
       this.color = 'white';
-      this.feed
-      .loadHomeTimeline()
-      .then(tweets => (this.tweets = tweets))
-      .catch(err => console.error(err))
-      .then(() => loading.dismiss());
+      this.tweets =this.cachedTweets;
+      loading.dismiss();
     }
     
   }

+ 2 - 2
app/src/providers/crypto/crypto.ts

@@ -50,7 +50,7 @@ export class CryptoProvider {
     }
 
     if(privateKeyHistory){
-      // Ecnrypt key history
+      // Encrypt key history
       const encryptedPrivateKeyHistory = JSON.stringify(privateKeyHistory);
 
       // Publish updated key history...
@@ -66,7 +66,7 @@ export class CryptoProvider {
   private async getKeyHistory(userId: string) {
     //get private key history from gun
     let link = await this.gun.getPvtKeyHistory(userId);
-    // Fetch public key history
+    // Fetch Private key history
     if (link) {
       const encryptedKeyHistory = await this.ipfs.fetchJson(link.key);
       // Decrypt key history

+ 0 - 1
app/src/providers/pgp-key-server/pgp-key-server.ts

@@ -73,7 +73,6 @@ export class PgpKeyServerProvider {
   }
 
   public async decrypt(encrypted: string, privKeyObj) {
-    
     const options2 = {
       message: await openpgp.message.readArmored(encrypted), // parse armored message
       privateKeys: [privKeyObj] // for decryption