From d29459fa3781043c4e484c876966dbae5c98a538 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 26 May 2018 23:53:22 +0900 Subject: Fix bug --- src/client/app/mobile/views/components/user-list-timeline.vue | 8 ++++++-- src/client/app/mobile/views/components/user-timeline.vue | 9 +++++++-- src/client/app/mobile/views/pages/home.timeline.vue | 8 ++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/user-list-timeline.vue b/src/client/app/mobile/views/components/user-list-timeline.vue index c0ba995b68..629151302c 100644 --- a/src/client/app/mobile/views/components/user-list-timeline.vue +++ b/src/client/app/mobile/views/components/user-list-timeline.vue @@ -77,13 +77,15 @@ export default Vue.extend({ this.moreFetching = true; - (this as any).api('notes/user-list-timeline', { + const promise = (this as any).api('notes/user-list-timeline', { listId: this.list.id, limit: fetchLimit + 1, untilId: (this.$refs.timeline as any).tail().id, includeMyRenotes: (this as any).clientSettings.showMyRenotes, includeRenotedMyNotes: (this as any).clientSettings.showRenotedMyNotes - }).then(notes => { + }); + + promise.then(notes => { if (notes.length == fetchLimit + 1) { notes.pop(); } else { @@ -92,6 +94,8 @@ export default Vue.extend({ notes.forEach(n => (this.$refs.timeline as any).append(n)); this.moreFetching = false; }); + + return promise; }, onNote(note) { diff --git a/src/client/app/mobile/views/components/user-timeline.vue b/src/client/app/mobile/views/components/user-timeline.vue index aca6f783b8..6be675c0a7 100644 --- a/src/client/app/mobile/views/components/user-timeline.vue +++ b/src/client/app/mobile/views/components/user-timeline.vue @@ -59,12 +59,15 @@ export default Vue.extend({ if (!this.canFetchMore) return; this.moreFetching = true; - (this as any).api('users/notes', { + + const promise = (this as any).api('users/notes', { userId: this.user.id, withMedia: this.withMedia, limit: fetchLimit + 1, untilId: (this.$refs.timeline as any).tail().id - }).then(notes => { + }); + + promise.then(notes => { if (notes.length == fetchLimit + 1) { notes.pop(); } else { @@ -73,6 +76,8 @@ export default Vue.extend({ notes.forEach(n => (this.$refs.timeline as any).append(n)); this.moreFetching = false; }); + + return promise; } } }); diff --git a/src/client/app/mobile/views/pages/home.timeline.vue b/src/client/app/mobile/views/pages/home.timeline.vue index 4c1c344db1..9ebce53de7 100644 --- a/src/client/app/mobile/views/pages/home.timeline.vue +++ b/src/client/app/mobile/views/pages/home.timeline.vue @@ -111,12 +111,14 @@ export default Vue.extend({ this.moreFetching = true; - (this as any).api(this.endpoint, { + const promise = (this as any).api(this.endpoint, { limit: fetchLimit + 1, untilId: (this.$refs.timeline as any).tail().id, includeMyRenotes: (this as any).clientSettings.showMyRenotes, includeRenotedMyNotes: (this as any).clientSettings.showRenotedMyNotes - }).then(notes => { + }); + + promise.then(notes => { if (notes.length == fetchLimit + 1) { notes.pop(); } else { @@ -125,6 +127,8 @@ export default Vue.extend({ notes.forEach(n => (this.$refs.timeline as any).append(n)); this.moreFetching = false; }); + + return promise; }, onNote(note) { -- cgit v1.2.3-freya