refactor: block-hub in tool wrapper (#3073)

This commit is contained in:
Alex Yang
2023-07-06 23:18:58 +08:00
committed by GitHub
parent 00ce086e79
commit fafd93f7dc
8 changed files with 58 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
import type { WorkspaceAdapter } from '@affine/env/workspace';
import { WorkspaceFlavour, WorkspaceVersion } from '@affine/env/workspace';
import type { EditorContainer } from '@blocksuite/editor';
import type { BlockHub } from '@blocksuite/blocks';
import { assertExists } from '@blocksuite/global/utils';
import { atom } from 'jotai';
import Router from 'next/router';
@@ -264,8 +264,7 @@ rootCurrentPageIdAtom.onMount = set => {
return;
};
// current editor atom, each app should have only one editor in the same time
export const rootCurrentEditorAtom = atom<Readonly<EditorContainer> | null>(
null
);
// blocksuite atoms,
// each app should have only one block-hub in the same time
export const rootBlockHubAtom = atom<Readonly<BlockHub> | null>(null);
//#endregion