diff options
Diffstat (limited to 'packages/frontend/src/scripts/use-note-capture.ts')
| -rw-r--r-- | packages/frontend/src/scripts/use-note-capture.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts index bda9c04ea4..d4e7e8104f 100644 --- a/packages/frontend/src/scripts/use-note-capture.ts +++ b/packages/frontend/src/scripts/use-note-capture.ts @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { onUnmounted, Ref } from 'vue'; +import { onUnmounted, Ref, ShallowRef } from 'vue'; import * as Misskey from 'misskey-js'; import { useStream } from '@/stream.js'; import { $i } from '@/account.js'; export function useNoteCapture(props: { - rootEl: Ref<HTMLElement>; + rootEl: ShallowRef<HTMLElement | undefined>; note: Ref<Misskey.entities.Note>; pureNote: Ref<Misskey.entities.Note>; isDeletedRef: Ref<boolean>; @@ -83,7 +83,7 @@ export function useNoteCapture(props: { function capture(withHandler = false): void { if (connection) { // TODO: このノートがストリーミング経由で流れてきた場合のみ sr する - connection.send(document.body.contains(props.rootEl.value) ? 'sr' : 's', { id: note.value.id }); + connection.send(document.body.contains(props.rootEl.value ?? null as Node | null) ? 'sr' : 's', { id: note.value.id }); if (pureNote.value.id !== note.value.id) connection.send('s', { id: pureNote.value.id }); if (withHandler) connection.on('noteUpdated', onStreamNoteUpdated); } |