diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index f0d318c408..4aa54918c0 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -493,7 +493,7 @@ onUnmounted(() => { }); onActivated(() => { - if (!unuse.value && appearNote.value) { + if (!unuse.value) { unuse.value = noteManager.useNote(appearNote.value?.id ?? props.note.id, true).unuse; } }); diff --git a/packages/frontend/src/scripts/entity-manager.ts b/packages/frontend/src/scripts/entity-manager.ts index 25cefe2e4a..61990d5d7f 100644 --- a/packages/frontend/src/scripts/entity-manager.ts +++ b/packages/frontend/src/scripts/entity-manager.ts @@ -373,9 +373,9 @@ export class NoteManager { * ノートを取得・監視 * キャプチャが要らなくなったら必ずunuseすること * @param id note id - * @returns { note, unuse } note: CachedNote | Promise, unuse: () => void + * @returns { note, unuse } note: CachedNote | Promise, unuse: (noDeletion?: boolean) => void */ - public useNote(id: string, shoudFetch: true): { note: Promise, unuse: () => void }; + public useNote(id: string, shoudFetch: true): { note: Promise, unuse: (noDeletion?: boolean) => void }; public useNote(id: string, shoudFetch = false) { const note = (!this.notesSource.has(id) || shoudFetch) ? this.fetch(id) : this.get(id)!; let using = false; @@ -389,7 +389,7 @@ export class NoteManager { }); const unuse = (noDeletion = false) => { - CapturePromise.then(() => { + CapturePromise.finally(() => { if (!using) return; this.decapture(id, noDeletion); using = false;