summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/use-note-capture.ts
diff options
context:
space:
mode:
authoratsuchan <83960488+atsu1125@users.noreply.github.com>2023-10-19 19:36:18 +0900
committerGitHub <noreply@github.com>2023-10-19 19:36:18 +0900
commit7b361224f8f8c5215700f70d2aea57a9befa8090 (patch)
treeebebd26c258f0421b85036d7623f3a835c6cce70 /packages/frontend/src/scripts/use-note-capture.ts
parentchore(deps): bump actions/checkout from 4.1.0 to 4.1.1 (#12062) (diff)
downloadmisskey-7b361224f8f8c5215700f70d2aea57a9befa8090.tar.gz
misskey-7b361224f8f8c5215700f70d2aea57a9befa8090.tar.bz2
misskey-7b361224f8f8c5215700f70d2aea57a9befa8090.zip
fix(frontend): Recieve Unrenote on streaming (#12079)
* fix(frontend): Recieve Unrenote 表示しているリノートがリノート解除されたらストリーミングで受信してすぐに消えるようにする * fix(frontend): Recieve Unrenote lint fixing * fix(frontend): Recieve Unrenote Decapture Decapture忘れてたー
Diffstat (limited to 'packages/frontend/src/scripts/use-note-capture.ts')
-rw-r--r--packages/frontend/src/scripts/use-note-capture.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/frontend/src/scripts/use-note-capture.ts b/packages/frontend/src/scripts/use-note-capture.ts
index c618532570..bda9c04ea4 100644
--- a/packages/frontend/src/scripts/use-note-capture.ts
+++ b/packages/frontend/src/scripts/use-note-capture.ts
@@ -11,15 +11,17 @@ import { $i } from '@/account.js';
export function useNoteCapture(props: {
rootEl: Ref<HTMLElement>;
note: Ref<Misskey.entities.Note>;
+ pureNote: Ref<Misskey.entities.Note>;
isDeletedRef: Ref<boolean>;
}) {
const note = props.note;
+ const pureNote = props.pureNote;
const connection = $i ? useStream() : null;
function onStreamNoteUpdated(noteData): void {
const { type, id, body } = noteData;
- if (id !== note.value.id) return;
+ if ((id !== note.value.id) && (id !== pureNote.value.id)) return;
switch (type) {
case 'reacted': {
@@ -82,6 +84,7 @@ export function useNoteCapture(props: {
if (connection) {
// TODO: このノートがストリーミング経由で流れてきた場合のみ sr する
connection.send(document.body.contains(props.rootEl.value) ? '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);
}
}
@@ -91,6 +94,11 @@ export function useNoteCapture(props: {
connection.send('un', {
id: note.value.id,
});
+ if (pureNote.value.id !== note.value.id) {
+ connection.send('un', {
+ id: pureNote.value.id,
+ });
+ }
if (withHandler) connection.off('noteUpdated', onStreamNoteUpdated);
}
}