feat: set the correct mode when loading the page (#1069)

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
zqranandHimself65 authored and GitHub committed 2023-02-23 16:22:00 +08:00
1 parent dcd11aa782
commit 8ee5d422cb
4 files changed
+15 -6

No files matched your search

+1
View File
@@ -39,6 +39,7 @@ export const Editor = ({
const editor = new EditorContainer();
editor.page = page;
editor.mode = page.meta.mode as typeof editor.mode;
editorContainer.current?.appendChild(editor);
if (page.isEmpty) {
+1
View File
@@ -62,6 +62,7 @@ export const usePageHelper = (): EditorHandlers => {
addedPageId => {
currentWorkspace.blocksuiteWorkspace?.setPageMeta(addedPageId, {
title,
mode: 'page',
});
resolve(addedPageId);
}