|
@@ -70,7 +70,7 @@ export class ProfilePage {
|
|
|
}
|
|
|
|
|
|
doRefresh(refresher) {
|
|
|
- this.loadTimeline(this.user.id).then(res => {
|
|
|
+ this.loadTimeline(this.user.id_str).then(res => {
|
|
|
if (res.length > 0) {
|
|
|
// Replace tweets
|
|
|
this.tweets = res;
|
|
@@ -88,19 +88,21 @@ export class ProfilePage {
|
|
|
|
|
|
loadMore(infiniteScroll: InfiniteScroll) {
|
|
|
if (this.enableInfiniteScroll) {
|
|
|
- this.loadTimeline(this.user.id, this.oldestLoadedTweetId).then(res => {
|
|
|
- if (res.length > 0) {
|
|
|
- // Append loaded tweets
|
|
|
- this.tweets = this.tweets.concat(res);
|
|
|
-
|
|
|
- // Save oldest tweet's id for next load more
|
|
|
- this.oldestLoadedTweetId = res
|
|
|
- .filter(tweet => !tweet.private_tweet)
|
|
|
- .reduce((acc, cur) => (acc.id < cur.id ? acc : cur))["id"];
|
|
|
+ this.loadTimeline(this.user.id_str, this.oldestLoadedTweetId).then(
|
|
|
+ res => {
|
|
|
+ if (res.length > 0) {
|
|
|
+ // Append loaded tweets
|
|
|
+ this.tweets = this.tweets.concat(res);
|
|
|
+
|
|
|
+ // Save oldest tweet's id for next load more
|
|
|
+ this.oldestLoadedTweetId = res
|
|
|
+ .filter(tweet => !tweet.private_tweet)
|
|
|
+ .reduce((acc, cur) => (acc.id < cur.id ? acc : cur))["id"];
|
|
|
+ }
|
|
|
+ // Hide loading icon
|
|
|
+ infiniteScroll.complete();
|
|
|
}
|
|
|
- // Hide loading icon
|
|
|
- infiniteScroll.complete();
|
|
|
- });
|
|
|
+ );
|
|
|
} else {
|
|
|
// Hide loading icon
|
|
|
infiniteScroll.complete();
|