diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index f2c1ca878..0229521a8 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -578,7 +578,7 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any, brea json.blockId = layout.editor.protyle.block.id; json.rootId = layout.editor.protyle.block.rootID; json.mode = layout.editor.protyle.preview.element.classList.contains("fn__none") ? "wysiwyg" : "preview"; - json.action = layout.editor.protyle.block.showAll ? Constants.CB_GET_ALL : Constants.CB_GET_SCROLL; + json.action = (layout.editor.protyle.block.showAll && layout.editor.protyle.block.id !== layout.editor.protyle.block.rootID) ? Constants.CB_GET_ALL : Constants.CB_GET_SCROLL; json.instance = "Editor"; } else if (layout instanceof Asset) { json.path = layout.path; diff --git a/app/src/protyle/scroll/saveScroll.ts b/app/src/protyle/scroll/saveScroll.ts index d85aaca14..f4a69cf05 100644 --- a/app/src/protyle/scroll/saveScroll.ts +++ b/app/src/protyle/scroll/saveScroll.ts @@ -67,7 +67,7 @@ export const getDocByScroll = (options: { actions = [Constants.CB_GET_UNUNDO]; } } - if (options.scrollAttr?.zoomInId) { + if (options.scrollAttr?.zoomInId && options.scrollAttr?.rootId && options.scrollAttr.zoomInId !== options.scrollAttr.rootId) { fetchPost("/api/filetree/getDoc", { id: options.scrollAttr.zoomInId, size: Constants.SIZE_GET_MAX,