From f75ee1eef015d33589f2016b067de82d01e2ca2d Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Fri, 1 Sep 2023 09:36:19 +0900
Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E3=83=8E=E3=83=BC?=
 =?UTF-8?q?=E3=83=88=E8=A9=B3=E7=B4=B0=E3=83=9A=E3=83=BC=E3=82=B8=E8=AA=AD?=
 =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=81=BF=E6=99=82=E3=81=AB=E5=89=8D=E5=BE=8C?=
 =?UTF-8?q?=E3=81=AE=E3=83=8E=E3=83=BC=E3=83=88=E3=81=AE=E5=AD=98=E5=9C=A8?=
 =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E8=A1=8C=E3=82=8F?=
 =?UTF-8?q?=E3=81=AA=E3=81=9A=E3=80=81=E5=B8=B8=E3=81=AB=E5=AD=98=E5=9C=A8?=
 =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=A8=E4=BB=AE=E5=AE=9A=E3=81=99=E3=82=8B?=
 =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=A6=E3=83=91=E3=83=95?=
 =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=B3=E3=82=B9=E3=82=92=E5=90=91?=
 =?UTF-8?q?=E4=B8=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 CHANGELOG.md                         |  1 +
 packages/frontend/src/pages/note.vue | 22 +++-------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04eab47070..9e210543c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@
 - メニューのスイッチの動作を改善
 - 絵文字ピッカーの検索の表示件数を100件に増加
 - 投稿フォームのプレビューの表示状態を記憶するように
+- ノート詳細ページ読み込み時のパフォーマンスを改善
 - Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように
 - Enhance: 自分が押したリアクションのデザインを改善
 - Enhance: ノート検索にローカルのみ検索可能なオプションの追加
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;