mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 18:41:52 +08:00
feat: seperate createDoc and createStore (#11182)
This commit is contained in:
+2
-2
@@ -87,8 +87,8 @@ async function initDoc(name: DocName) {
|
||||
schema: getAFFiNEWorkspaceSchema(),
|
||||
blobCRUD: collection.blobSync,
|
||||
docCRUD: {
|
||||
create: (id: string) => collection.createDoc({ id }),
|
||||
get: (id: string) => collection.getDoc(id),
|
||||
create: (id: string) => collection.createDoc(id).getStore({ id }),
|
||||
get: (id: string) => collection.getDoc(id)?.getStore({ id }) ?? null,
|
||||
delete: (id: string) => collection.removeDoc(id),
|
||||
},
|
||||
middlewares: [],
|
||||
|
||||
@@ -96,7 +96,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
|
||||
},
|
||||
getDoc: (docId: string) => {
|
||||
const doc = workspaceService.workspace.docCollection.getDoc(docId);
|
||||
return doc;
|
||||
return doc?.getStore() ?? null;
|
||||
},
|
||||
getReferenceDocs: (docIds: string[]) => {
|
||||
const docs$ = docsSearchService.watchRefsFrom(docIds);
|
||||
|
||||
Reference in New Issue
Block a user