From 70b363f4c31ee923c08e75a57575530862c67f6e Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 7 Aug 2023 01:44:22 +0000 Subject: [PATCH] :v: --- packages/frontend/src/scripts/entity-manager.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/scripts/entity-manager.ts b/packages/frontend/src/scripts/entity-manager.ts index 5bd7c11e46..e32ba3ee6e 100644 --- a/packages/frontend/src/scripts/entity-manager.ts +++ b/packages/frontend/src/scripts/entity-manager.ts @@ -207,6 +207,15 @@ export class NoteManager { executeInterruptor: () => Promise, } { const note = this.get(id); + if (noteViewInterruptors.length === 0) { + // noteViewInterruptorがない場合はcomputed noteを直接渡す + return { + interruptedNote: note as InterruptedCachedNote, + interruptorUnwatch: () => { }, + executeInterruptor: () => Promise.resolve(), + }; + } + const interruptedNote = ref(note.value); async function executeInterruptor() { @@ -215,11 +224,6 @@ export class NoteManager { return; } - if (noteViewInterruptors.length === 0) { - interruptedNote.value = note.value; - return; - } - let result = deepClone(note.value); for (const interruptor of noteViewInterruptors) { result = await interruptor.handler(result) as Note;