From c21a24ee928e307b0583d7abb109cfae64dcc131 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 19 Oct 2023 14:46:20 +0900 Subject: [PATCH] fix: null error in renote button --- .../client/src/components/MkRenoteButton.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 90ecb3217f..0c0790d86e 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -73,13 +73,16 @@ useTooltip(buttonRef, async (showing) => { }); const hasRenotedBefore = ref(false); -os.api("notes/renotes", { - noteId: props.note.id, - userId: $i.id, - limit: 1, -}).then((res) => { - hasRenotedBefore.value = res.length > 0; -}); + +if ($i != null) { + os.api("notes/renotes", { + noteId: props.note.id, + userId: $i.id, + limit: 1, + }).then((res) => { + hasRenotedBefore.value = res.length > 0; + }); +} const renote = (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin();