This commit is contained in:
tamaina 2023-08-06 12:46:13 +00:00
parent b73f88fe54
commit db15cab350
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}
});

View File

@ -373,9 +373,9 @@ export class NoteManager {
*
* unuseすること
* @param id note id
* @returns { note, unuse } note: CachedNote | Promise<CachedNote>, unuse: () => void
* @returns { note, unuse } note: CachedNote | Promise<CachedNote>, unuse: (noDeletion?: boolean) => void
*/
public useNote(id: string, shoudFetch: true): { note: Promise<CachedNote>, unuse: () => void };
public useNote(id: string, shoudFetch: true): { note: Promise<CachedNote>, 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;