fix?
This commit is contained in:
parent
b73f88fe54
commit
db15cab350
|
@ -493,7 +493,7 @@ onUnmounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onActivated(() => {
|
onActivated(() => {
|
||||||
if (!unuse.value && appearNote.value) {
|
if (!unuse.value) {
|
||||||
unuse.value = noteManager.useNote(appearNote.value?.id ?? props.note.id, true).unuse;
|
unuse.value = noteManager.useNote(appearNote.value?.id ?? props.note.id, true).unuse;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -373,9 +373,9 @@ export class NoteManager {
|
||||||
* ノートを取得・監視
|
* ノートを取得・監視
|
||||||
* キャプチャが要らなくなったら必ずunuseすること
|
* キャプチャが要らなくなったら必ずunuseすること
|
||||||
* @param id note id
|
* @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) {
|
public useNote(id: string, shoudFetch = false) {
|
||||||
const note = (!this.notesSource.has(id) || shoudFetch) ? this.fetch(id) : this.get(id)!;
|
const note = (!this.notesSource.has(id) || shoudFetch) ? this.fetch(id) : this.get(id)!;
|
||||||
let using = false;
|
let using = false;
|
||||||
|
@ -389,7 +389,7 @@ export class NoteManager {
|
||||||
});
|
});
|
||||||
|
|
||||||
const unuse = (noDeletion = false) => {
|
const unuse = (noDeletion = false) => {
|
||||||
CapturePromise.then(() => {
|
CapturePromise.finally(() => {
|
||||||
if (!using) return;
|
if (!using) return;
|
||||||
this.decapture(id, noDeletion);
|
this.decapture(id, noDeletion);
|
||||||
using = false;
|
using = false;
|
||||||
|
|
Loading…
Reference in New Issue