diff --git a/public/js/components.js b/public/js/components.js index b886d7bc6..bbc90ac16 100644 Binary files a/public/js/components.js and b/public/js/components.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 5dd5a94ad..144c7c541 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index acb04f004..00a136140 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -219,7 +219,7 @@ export default { data() { return { - page: 1, + page: 2, feed: [], profile: {}, scope: window.location.pathname, @@ -228,6 +228,7 @@ notifications: {}, stories: {}, suggestions: {}, + loading: true, } }, @@ -260,8 +261,8 @@ }, fetchTimelineApi() { - let homeTimeline = '/api/v1/timelines/home?page=' + this.page; - let localTimeline = '/api/v1/timelines/public?page=' + this.page; + let homeTimeline = '/api/v1/timelines/home?page=1'; + let localTimeline = '/api/v1/timelines/public?page=1'; let apiUrl = this.scope == '/' ? homeTimeline : localTimeline; axios.get(apiUrl).then(res => { $('.timeline .loader').addClass('d-none'); @@ -272,7 +273,7 @@ if(this.page == 1) { this.max_id = Math.max(...ids); } - this.page++; + this.loading = false; }).catch(err => { }); }, @@ -286,8 +287,7 @@ page: this.page, }, }).then(res => { - if (res.data.length) { - $('.timeline .loader').addClass('d-none'); + if (res.data.length && this.loading == false) { let data = res.data; this.feed.push(...data); let ids = data.map(status => status.id); @@ -297,6 +297,7 @@ } this.page += 1; $state.loaded(); + this.loading = false; } else { $state.complete(); }