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.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix: regression on the database and bookmark block (#2737)
Himself65bf6af934f6dd
diff --git a/apps/web/src/adapters/local/index.tsx b/apps/web/src/adapters/local/index.tsxindex 158734a8a8..cd0011f26e 100644--- a/apps/web/src/adapters/local/index.tsx+++ b/apps/web/src/adapters/local/index.tsx@@ -19,7 +19,6 @@ import { createIndexedDBBackgroundProvider } from '@affine/workspace/providers';import { createEmptyBlockSuiteWorkspace } from '@affine/workspace/utils';import { nanoid } from '@blocksuite/store';-import { setEditorFlags } from '../../utils/editor-flag';import {BlockSuitePageList,PageDetailEditor,@@ -44,7 +43,6 @@ export const LocalAdapter: WorkspaceAdapter<WorkspaceFlavour.LOCAL> = {const page = blockSuiteWorkspace.createPage({id: DEFAULT_HELLO_WORLD_PAGE_ID,});- setEditorFlags(blockSuiteWorkspace);if (config.enablePreloading) {initPageWithPreloading(page).catch(err => {logger.error('init page with preloading failed', err);diff --git a/apps/web/src/layouts/workspace-layout.tsx b/apps/web/src/layouts/workspace-layout.tsxindex f41a3a533b..03dff06b5e 100644--- a/apps/web/src/layouts/workspace-layout.tsx+++ b/apps/web/src/layouts/workspace-layout.tsx@@ -64,7 +64,6 @@ import {} from '../providers/modal-provider';import { pathGenerator, publicPathGenerator } from '../shared';import { toast } from '../utils';-import { setEditorFlags } from '../utils/editor-flag';const QuickSearchModal = lazy(() =>import('../components/pure/quick-search-modal').then(module => ({@@ -311,7 +310,6 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {id: pageId,});assertEquals(page.id, pageId);- setEditorFlags(currentWorkspace.blockSuiteWorkspace);if (config.enablePreloading) {initPageWithPreloading(page).catch(error => {console.error('import error:', error);diff --git a/apps/web/src/utils/editor-flag.ts b/apps/web/src/utils/editor-flag.tsdeleted file mode 100644index 968ece8268..0000000000--- a/apps/web/src/utils/editor-flag.ts+++ /dev/null@@ -1,12 +0,0 @@-import { type BlockSuiteFeatureFlags, config } from '@affine/env';--import type { BlockSuiteWorkspace } from '../shared';--export function setEditorFlags(blockSuiteWorkspace: BlockSuiteWorkspace) {- Object.entries(config.editorFlags).forEach(([key, value]) => {- blockSuiteWorkspace.awarenessStore.setFlag(- key as keyof BlockSuiteFeatureFlags,- value- );- });-}diff --git a/packages/workspace/src/utils.ts b/packages/workspace/src/utils.tsindex 584ad14b0e..2ee0268101 100644--- a/packages/workspace/src/utils.ts+++ b/packages/workspace/src/utils.ts@@ -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;}