diff --git a/public/js/profile.js b/public/js/profile.js index 247ad4c86..1c91032c6 100644 Binary files a/public/js/profile.js and b/public/js/profile.js differ diff --git a/public/js/timeline.js b/public/js/timeline.js index a8f7ed6de..882c0d051 100644 Binary files a/public/js/timeline.js and b/public/js/timeline.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index a35879436..21b26edc2 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/Profile.vue b/resources/assets/js/components/Profile.vue index 54dbc6a45..3c4bcc206 100644 --- a/resources/assets/js/components/Profile.vue +++ b/resources/assets/js/components/Profile.vue @@ -516,6 +516,7 @@ export default { ], data() { return { + ids: [], profile: {}, user: {}, timeline: [], @@ -568,6 +569,7 @@ export default { .then(res => { let data = res.data; let ids = data.map(status => status.id); + this.ids = ids; this.min_id = Math.max(...ids); this.max_id = Math.min(...ids); this.modalStatus = _.first(res.data); @@ -601,9 +603,15 @@ export default { }).then(res => { if (res.data.length && this.loading == false) { let data = res.data; - let ids = data.map(status => status.id); - this.max_id = Math.min(...ids); - this.timeline.push(...data); + let self = this; + data.forEach(d => { + if(self.ids.indexOf(d.id) == -1) { + self.timeline.push(d); + self.ids.push(d.id); + } + }); + this.min_id = Math.max(...this.ids); + this.max_id = Math.min(...this.ids); $state.loaded(); this.loading = false; } else { diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index 203a415ae..2e11d3b37 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -430,6 +430,7 @@ props: ['scope'], data() { return { + ids: [], config: {}, page: 2, feed: [], @@ -544,6 +545,7 @@ let data = res.data; this.feed.push(...data); let ids = data.map(status => status.id); + this.ids = ids; this.min_id = Math.max(...ids); this.max_id = Math.min(...ids); $('.timeline .pagination').removeClass('d-none'); @@ -579,10 +581,15 @@ }).then(res => { if (res.data.length && this.loading == false) { let data = res.data; - this.feed.push(...data); - let ids = data.map(status => status.id); - this.min_id = Math.max(...ids); - this.max_id = Math.min(...ids); + let self = this; + data.forEach(d => { + if(self.ids.indexOf(d.id) == -1) { + self.feed.push(d); + self.ids.push(d.id); + } + }); + this.min_id = Math.max(...this.ids); + this.max_id = Math.min(...this.ids); this.page += 1; $state.loaded(); this.loading = false;