fix(core): clicking change mode in the menu should switch both view and mode (#8562)

close AF-1524
This commit is contained in:
JimmFly
2024-10-22 03:29:06 +00:00
parent ed511f8d29
commit 8c0ee0f52b

View File

@@ -150,6 +150,7 @@ export const PageHeaderMenuButton = ({
const handleSwitchMode = useCallback(() => {
const mode = primaryMode === 'page' ? 'edgeless' : 'page';
editorService.editor.setMode(mode);
editorService.editor.doc.setPrimaryMode(mode);
track.$.header.docOptions.switchPageMode({
mode,