diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts index db21dcba1..3511e7a93 100644 --- a/packages/frontend/src/scripts/use-note-capture.ts +++ b/packages/frontend/src/scripts/use-note-capture.ts @@ -86,9 +86,14 @@ export function useNoteCapture(props: { function capture(withHandler = false): void { if (connection) { + let command: string; if ($i && (note.value?.visibleUserIds?.includes($i.id) ?? note.value?.mentions?.includes($i.id))) { - connection.send(document.body.contains(props.rootEl.value ?? null as Node | null) ? 'sr' : 's', { id: note.value.id }); + command = document.body.contains(props.rootEl.value ?? null as Node | null) ? 'sr' : 's'; + } else { + command = 's'; } + + connection.send(command, { id: note.value.id }); if (pureNote.value.id !== note.value.id) connection.send('s', { id: pureNote.value.id }); if (withHandler) connection.on('noteUpdated', onStreamNoteUpdated); }