diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-08 14:17:44 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-08 14:17:44 +0900 |
| commit | 1e166490d9bd76cde3b0acaed8c678761b745e5e (patch) | |
| tree | 267f23191db2131a34352907a8cf413130acbbb4 /src/client/app/desktop/views/components/notes.vue | |
| parent | i18n (diff) | |
| download | misskey-1e166490d9bd76cde3b0acaed8c678761b745e5e.tar.gz misskey-1e166490d9bd76cde3b0acaed8c678761b745e5e.tar.bz2 misskey-1e166490d9bd76cde3b0acaed8c678761b745e5e.zip | |
[Client] Better pagination
Fix #4628
Close #4629
Diffstat (limited to 'src/client/app/desktop/views/components/notes.vue')
| -rw-r--r-- | src/client/app/desktop/views/components/notes.vue | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/app/desktop/views/components/notes.vue b/src/client/app/desktop/views/components/notes.vue index 4334e78451..c98ac1e9b3 100644 --- a/src/client/app/desktop/views/components/notes.vue +++ b/src/client/app/desktop/views/components/notes.vue @@ -25,7 +25,7 @@ </template> </component> - <footer v-if="cursor != null"> + <footer v-if="more"> <button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }"> <template v-if="!moreFetching">{{ $t('@.load-more') }}</template> <template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template> @@ -58,7 +58,7 @@ export default Vue.extend({ fetching: true, moreFetching: false, inited: false, - cursor: null + more: false }; }, @@ -112,7 +112,7 @@ export default Vue.extend({ this.notes = x; } else { this.notes = x.notes; - this.cursor = x.cursor; + this.more = x.more; } this.inited = true; this.fetching = false; @@ -123,11 +123,11 @@ export default Vue.extend({ }, more() { - if (this.cursor == null || this.moreFetching) return; + if (!this.more || this.moreFetching) return; this.moreFetching = true; - this.makePromise(this.cursor).then(x => { + this.makePromise(this.notes[this.notes.length - 1].id).then(x => { this.notes = this.notes.concat(x.notes); - this.cursor = x.cursor; + this.more = x.more; this.moreFetching = false; }, e => { this.moreFetching = false; @@ -157,6 +157,7 @@ export default Vue.extend({ // オーバーフローしたら古い投稿は捨てる if (this.notes.length >= displayLimit) { this.notes = this.notes.slice(0, displayLimit); + this.more = true; } } else { this.queue.push(note); |