fix: null error in renote button

This commit is contained in:
naskya 2023-10-19 14:46:20 +09:00
parent fd3d788aad
commit c21a24ee92
No known key found for this signature in database
GPG key ID: 164DFF24E2D40139

View file

@ -73,6 +73,8 @@ useTooltip(buttonRef, async (showing) => {
}); });
const hasRenotedBefore = ref(false); const hasRenotedBefore = ref(false);
if ($i != null) {
os.api("notes/renotes", { os.api("notes/renotes", {
noteId: props.note.id, noteId: props.note.id,
userId: $i.id, userId: $i.id,
@ -80,6 +82,7 @@ os.api("notes/renotes", {
}).then((res) => { }).then((res) => {
hasRenotedBefore.value = res.length > 0; hasRenotedBefore.value = res.length > 0;
}); });
}
const renote = (viaKeyboard = false, ev?: MouseEvent) => { const renote = (viaKeyboard = false, ev?: MouseEvent) => {
pleaseLogin(); pleaseLogin();