From ffaccde71461a3b96ee07f20184986a6d1880d7a Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 19 Oct 2023 14:48:53 +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 90ecb321..0c0790d8 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();