diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-01 09:36:19 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-01 09:36:19 +0900 |
| commit | f75ee1eef015d33589f2016b067de82d01e2ca2d (patch) | |
| tree | b635278ee89997bf7d63acc23184bfd2366a5adf /packages/frontend | |
| parent | build(deps): bump docker/setup-buildx-action from 2.9.1 to 2.10.0 (#11769) (diff) | |
| download | sharkey-f75ee1eef015d33589f2016b067de82d01e2ca2d.tar.gz sharkey-f75ee1eef015d33589f2016b067de82d01e2ca2d.tar.bz2 sharkey-f75ee1eef015d33589f2016b067de82d01e2ca2d.zip | |
enhance(frontend): ノート詳細ページ読み込み時に前後のノートの存在チェックを行わなず、常に存在すると仮定するようにしてパフォーマンスを向上
Diffstat (limited to 'packages/frontend')
| -rw-r--r-- | packages/frontend/src/pages/note.vue | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/packages/frontend/src/pages/note.vue b/packages/frontend/src/pages/note.vue index fb19783f3d..48f62c83a9 100644 --- a/packages/frontend/src/pages/note.vue +++ b/packages/frontend/src/pages/note.vue @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only </div> <div class="_margin"> - <MkButton v-if="!showNext && hasNext" :class="$style.loadNext" @click="showNext = true"><i class="ti ti-chevron-up"></i></MkButton> + <MkButton v-if="!showNext" :class="$style.loadNext" @click="showNext = true"><i class="ti ti-chevron-up"></i></MkButton> <div class="_margin _gaps_s"> <MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/> <MkNoteDetailed :key="note.id" v-model:note="note" :class="$style.note"/> @@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only </MkA> </div> </div> - <MkButton v-if="!showPrev && hasPrev" :class="$style.loadPrev" @click="showPrev = true"><i class="ti ti-chevron-down"></i></MkButton> + <MkButton v-if="!showPrev" :class="$style.loadPrev" @click="showPrev = true"><i class="ti ti-chevron-down"></i></MkButton> </div> <div v-if="showPrev" class="_margin"> @@ -63,8 +63,6 @@ const props = defineProps<{ let note = $ref<null | misskey.entities.Note>(); let clips = $ref(); -let hasPrev = $ref(false); -let hasNext = $ref(false); let showPrev = $ref(false); let showNext = $ref(false); let error = $ref(); @@ -89,8 +87,6 @@ const nextPagination = { }; function fetchNote() { - hasPrev = false; - hasNext = false; showPrev = false; showNext = false; note = null; @@ -102,20 +98,8 @@ function fetchNote() { os.api('notes/clips', { noteId: note.id, }), - os.api('users/notes', { - userId: note.userId, - untilId: note.id, - limit: 1, - }), - os.api('users/notes', { - userId: note.userId, - sinceId: note.id, - limit: 1, - }), - ]).then(([_clips, prev, next]) => { + ]).then(([_clips]) => { clips = _clips; - hasPrev = prev.length !== 0; - hasNext = next.length !== 0; }); }).catch(err => { error = err; |