fix: cleanup editor layout (#3822)

This commit is contained in:
Alex Yang 2023-08-17 23:37:56 -05:00 committed by GitHub
parent e4e17ff606
commit 71cf36a300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View File

@ -106,11 +106,6 @@ const deleteLayoutAtom = atom<null, [string], void>(null, (_, set, id) => {
});
});
// clean up plugin windows when switching to other pages
rootStore.sub(currentPageAtom, () => {
rootStore.set(contentLayoutAtom, 'editor');
});
// module -> importName -> updater[]
export const _rootImportsMap = new Map<string, Map<string, any>>();
const rootImportsMapSetupPromise = setupImportsMap(_rootImportsMap, {

View File

@ -100,7 +100,6 @@ export function WorkspaceHeader({
/>
}
center={<WorkspaceModeFilterTab />}
right={<PluginHeader />}
/>
{<FilterContainer workspaceId={currentWorkspaceId} />}
</>

View File

@ -8,6 +8,7 @@ import type { EditorContainer } from '@blocksuite/editor';
import { assertExists } from '@blocksuite/global/utils';
import type { Page } from '@blocksuite/store';
import {
contentLayoutAtom,
currentPageIdAtom,
currentWorkspaceAtom,
currentWorkspaceIdAtom,
@ -86,6 +87,7 @@ export const DetailPage = (): ReactElement => {
};
export const loader: LoaderFunction = async args => {
rootStore.set(contentLayoutAtom, 'editor');
if (args.params.workspaceId) {
localStorage.setItem('last_workspace_id', args.params.workspaceId);
rootStore.set(currentWorkspaceIdAtom, args.params.workspaceId);