mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: regression on the database and bookmark block (#2737)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { BlockSuiteFeatureFlags } from '@affine/env';
|
||||
import { config } from '@affine/env';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||
import type { Generator, StoreOptions } from '@blocksuite/store';
|
||||
@@ -14,6 +16,15 @@ export function cleanupWorkspace(flavour: WorkspaceFlavour) {
|
||||
);
|
||||
}
|
||||
|
||||
function setEditorFlags(workspace: Workspace) {
|
||||
Object.entries(config.editorFlags).forEach(([key, value]) => {
|
||||
workspace.awarenessStore.setFlag(
|
||||
key as keyof BlockSuiteFeatureFlags,
|
||||
value
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
const hashMap = new Map<string, Workspace>();
|
||||
|
||||
/**
|
||||
@@ -86,6 +97,7 @@ export function createEmptyBlockSuiteWorkspace(
|
||||
})
|
||||
.register(AffineSchemas)
|
||||
.register(__unstableSchemas);
|
||||
setEditorFlags(workspace);
|
||||
hashMap.set(cacheKey, workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user