From b3a22f49cb2667cadd430cfab1fb7d0577e0ad3b Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sun, 24 Jul 2022 23:36:07 +0200 Subject: [PATCH] client uses new API for child notes depth --- packages/client/src/components/MkNoteSub.vue | 25 +++++++------------ .../client/src/components/note-detailed.vue | 5 +++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index 9ae773bfb..aac3f233b 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -15,12 +15,14 @@ - @@ -36,7 +38,7 @@ import { i18n } from '@/i18n'; const props = withDefaults(defineProps<{ note: misskey.entities.Note; - detail?: boolean; + conversation?: misskey.entities.Note[]; // how many notes are in between this one and the note being viewed in detail depth?: number; @@ -45,16 +47,7 @@ const props = withDefaults(defineProps<{ }); let showContent = $ref(false); -let replies: misskey.entities.Note[] = $ref([]); - -if (props.detail) { - os.api('notes/children', { - noteId: props.note.id, - limit: 5, - }).then(res => { - replies = res; - }); -} +const replies: misskey.entities.Note[] = props.conversation?.filter(item => item.replyId === props.note.id || item.renoteId === props.note.id) ?? [];