|
@@ -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();
|
|
|
}
|
|
|
|
|
|
}
|