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,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();