mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
feat: seperate createDoc and createStore (#11182)
This commit is contained in:
@@ -100,7 +100,9 @@ export class DocDisplayMetaService
|
||||
return signal(DocDisplayMetaService.icons.deleted);
|
||||
}
|
||||
|
||||
let icon$ = this.iconMap.get(doc);
|
||||
const store = doc.getStore();
|
||||
|
||||
let icon$ = this.iconMap.get(store);
|
||||
|
||||
if (!icon$) {
|
||||
icon$ = signal(
|
||||
@@ -128,11 +130,11 @@ export class DocDisplayMetaService
|
||||
this.disposables.splice(index, 1);
|
||||
disposable.unsubscribe();
|
||||
}
|
||||
this.iconMap.delete(doc);
|
||||
this.iconMap.delete(store);
|
||||
}
|
||||
});
|
||||
this.disposables.push(docRemovedSubscription);
|
||||
this.iconMap.set(doc, icon$);
|
||||
this.iconMap.set(store, icon$);
|
||||
}
|
||||
|
||||
return computed(() => {
|
||||
@@ -165,7 +167,9 @@ export class DocDisplayMetaService
|
||||
return signal(title || 'Deleted doc');
|
||||
}
|
||||
|
||||
let title$ = this.titleMap.get(doc);
|
||||
const store = doc.getStore();
|
||||
|
||||
let title$ = this.titleMap.get(store);
|
||||
if (!title$) {
|
||||
title$ = signal(doc.meta?.title || 'Untitled');
|
||||
|
||||
@@ -185,11 +189,11 @@ export class DocDisplayMetaService
|
||||
this.disposables.splice(index, 1);
|
||||
disposable.unsubscribe();
|
||||
}
|
||||
this.iconMap.delete(doc);
|
||||
this.iconMap.delete(store);
|
||||
}
|
||||
});
|
||||
this.disposables.push(docRemovedSubscription);
|
||||
this.titleMap.set(doc, title$);
|
||||
this.titleMap.set(store, title$);
|
||||
}
|
||||
|
||||
return computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user