feat(core): use zip snapshot for onboarding page (#6495)

This commit is contained in:
EYHN
2024-04-15 02:16:08 +00:00
parent 9b620ecbc9
commit 1656b33ce3
17 changed files with 108 additions and 2009 deletions

View File

@@ -76,12 +76,6 @@ export class CloudWorkspaceListProvider implements WorkspaceListProvider {
): Promise<WorkspaceMetadata> {
const tempId = nanoid();
const docCollection = new DocCollection({
id: tempId,
idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema,
});
// create workspace on cloud, get workspace id
const {
createWorkspace: { id: workspaceId },
@@ -97,6 +91,19 @@ export class CloudWorkspaceListProvider implements WorkspaceListProvider {
? new SqliteDocStorage(workspaceId)
: new IndexedDBDocStorage(workspaceId);
const docCollection = new DocCollection({
id: tempId,
idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema,
blobStorages: [
() => {
return {
crud: blobStorage,
};
},
],
});
// apply initial state
await initial(docCollection, blobStorage);

View File

@@ -70,6 +70,13 @@ export class LocalWorkspaceListProvider implements WorkspaceListProvider {
id: id,
idGenerator: () => nanoid(),
schema: globalBlockSuiteSchema,
blobStorages: [
() => {
return {
crud: blobStorage,
};
},
],
});
// apply initial state