Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): blockVersions check (#4073)

Alex Yangf21426d23d4a
diff --git a/apps/core/src/layouts/workspace-layout.tsx b/apps/core/src/layouts/workspace-layout.tsx
index 368e4e0ab5..5c5350771f 100644
--- a/apps/core/src/layouts/workspace-layout.tsx
+++ b/apps/core/src/layouts/workspace-layout.tsx
@@ -140,11 +140,14 @@ export const WorkspaceLayoutInner = ({ children }: PropsWithChildren) => {
// this is a mistake in the
// 0.8.0 ~ 0.8.1
// 0.8.0-beta.0 ~ 0.8.0-beta.3
- // 0.9.0-canary.0 ~ 0.9.0-canary.3
+ // 0.8.0-canary.17 ~ 0.9.0-canary.3
const meta = currentWorkspace.blockSuiteWorkspace.doc.getMap('meta');
const blockVersions = meta.get('blockVersions');
- if (!(blockVersions instanceof YMap)) {
- console.log('fixing blockVersions');
+ if (
+ !(blockVersions instanceof YMap) &&
+ blockVersions != null &&
+ typeof blockVersions === 'object'
+ ) {
meta.set(
'blockVersions',
new YMap(Object.entries(blockVersions as Record<string, number>))