From cfff940b288370f61a36cb1975163bc5c05f5887 Mon Sep 17 00:00:00 2001 From: mei23 Date: Tue, 30 Apr 2019 11:34:27 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=B3=E3=82=B0?= =?UTF-8?q?=E6=89=B1=E3=81=84=E3=81=AE=E6=99=82=E3=81=AF=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E3=81=97=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en-US.yml | 3 ++- locales/ja-JP.yml | 3 ++- src/client/app/mobile/views/components/notes.vue | 16 +++++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index fb69aa98f799..272710f3239b 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -24,7 +24,8 @@ common: application-authorization: "Application authorizations" close: "Close" do-not-copy-paste: "Please do not enter or paste the code here. Account may be compromised." - go-first: "Go first page" + newest: "Newest" + next-page: "Next page" load-more: "Read more" enter-password: "Enter your password" 2fa: "Two-factor authentication" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index bcc5fa4cc958..fa8deec7d2c9 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -25,7 +25,8 @@ common: application-authorization: "アプリの連携" close: "閉じる" do-not-copy-paste: "ここにコードを入力したり張り付けたりしないでください。アカウントが不正利用される可能性があります。" - go-first: "最初のページへ" + newest: "最新" + next-page: "次のページ" load-more: "もっと読み込む" enter-password: "パスワードを入力してください" 2fa: "二段階認証" diff --git a/src/client/app/mobile/views/components/notes.vue b/src/client/app/mobile/views/components/notes.vue index 51c323adc2e8..24d8117c3e1b 100644 --- a/src/client/app/mobile/views/components/notes.vue +++ b/src/client/app/mobile/views/components/notes.vue @@ -11,7 +11,7 @@
- +
@@ -27,8 +27,9 @@ @@ -71,7 +72,11 @@ export default Vue.extend({ note._datetext = this.$t('@.month-and-day').replace('{month}', month.toString()).replace('{day}', date.toString()); return note; }); - } + }, + + hasNextPage(): boolean { + return this.cursor != null && this.notes.length >= displayLimit * 2; + }, }, watch: { @@ -134,7 +139,7 @@ export default Vue.extend({ this.moreFetching = true; this.makePromise(this.cursor).then(x => { // 改ページ - if (this.notes.length >= displayLimit * 2) { + if (this.hasNextPage) { this.paged = true; this.notes = x.notes; this.queue = []; @@ -190,13 +195,14 @@ export default Vue.extend({ } if (this.$store.state.settings.fetchOnScroll !== false) { + if (this.hasNextPage) return; // 親要素が display none だったら弾く // https://github.com/syuilo/misskey/issues/1569 // http://d.hatena.ne.jp/favril/20091105/1257403319 if (this.$el.offsetHeight == 0) return; const current = window.scrollY + window.innerHeight; - if (current > document.body.offsetHeight - 32) this.more(); + if (current > document.body.offsetHeight - 8) this.more(); } } }