From 3f709776f276ecfc9f3222278e1998f987ec6ca9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 7 May 2019 00:00:13 -0600 Subject: [PATCH 1/2] Update Timeline.vue and Profile.vue --- resources/assets/js/components/Profile.vue | 14 +++++++++++--- resources/assets/js/components/Timeline.vue | 15 +++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) 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; From 11145be445fd4ea9b46aa1f1ddb08f37ec02ba38 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 7 May 2019 00:00:40 -0600 Subject: [PATCH 2/2] Update compiled assets --- public/js/profile.js | Bin 60778 -> 60861 bytes public/js/timeline.js | Bin 63827 -> 63871 bytes public/mix-manifest.json | Bin 845 -> 845 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/public/js/profile.js b/public/js/profile.js index 247ad4c860e28a0e4362ae8b0959cefe8f47ce47..1c91032c6f86a2060a026507c3ed7c776f3a7347 100644 GIT binary patch delta 351 zcmaELi+S&D<_+!a%(-O+lM6UC_|1ad!<00wi}ms}GBx!QH#f7tWMl;kPPU&d#o}aC zW;*$yQ0L}s&QMNf5NH1iPmZJ%i!@WC)Wpe+E9EBZtrS8PNLwk4ETE6z>{vN*^M0WQ zCicvfVyoy_oz3>57R+owj%~iq=28hmrWD&^y_Cd~M4d$2RO@`bwEQC1#N-T(w9>rf zlFa-(jS|gjT|-;jL_MG$z0ACn)C&JJjS?VFQ%y}HQLiL3H#H|SFIBIgv^WE(SO=mI z!UL(&tku*>om?g%$C(N;LKDQBDIv!S=4}>{-l4!^1PqzY7pxyd!=1f($8;9K&0eb> mh%#5CW=$^Sl-q2Ll70 z>!l=?BGVJb+KNaMy947&}kb4$2OkTqxSLc@lFJ3$w3T%H;R#8vI~+P3vO4 zJdI3Ey~NEg*v|>EXQmWeMaSxF-X=AbjSa}L&DYuNsrZ&L!M0d0C9xz?C*L;JI#Dkz zzsNN)IYT3@G%vX%Ge1wGM6+7g(AG9z52!~kGcP5z!aq%;1jy4=Q`5-TOG`~n(JLq| z&HyUZfhdCTKq@qAHFZ)adnw9srh>F?2JNiKJ9cva2$5&BRJ)| kRvcojv6?0GU95UjP6A delta 281 zcmezWiTUy;<_(jWH`}vBu`m}07f+tUp|P2XbH32#71C4LCQnq6-JGO!j&bsDRZd3h z$yI8y9M)xtMGASg`IBXoVfvKT^X-b+!nxVO6im~D3Zl+Zd76yh!#>NJwX{m|HCMikD MMh1!IN?f&E0P4OFApigX