Revert "fix(frontend): Recieve Unrenote on streaming (#12079)"

This reverts commit 7b361224f8.
This commit is contained in:
NoriDev 2023-10-21 22:26:10 +09:00
parent ecdf08a0ba
commit 74ba9cae79
3 changed files with 1 additions and 11 deletions

View file

@ -296,7 +296,6 @@ onMounted(() => {
useNoteCapture({
rootEl: el,
note: $$(appearNote),
pureNote: $$(note),
isDeletedRef: isDeleted,
});

View file

@ -380,7 +380,6 @@ const reactionsPagination = $computed(() => ({
useNoteCapture({
rootEl: el,
note: $$(appearNote),
pureNote: $$(note),
isDeletedRef: isDeleted,
});

View file

@ -11,17 +11,15 @@ 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) && (id !== pureNote.value.id)) return;
if (id !== note.value.id) return;
switch (type) {
case 'reacted': {
@ -91,7 +89,6 @@ 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);
}
}
@ -101,11 +98,6 @@ 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);
}
}