diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 511c484b9..99eb97068 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -71,7 +71,7 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRoot id: item.editor.protyle.block.rootID, }, (response) => { item.editor.protyle.wysiwyg.renderCustom(response.data.ial); - reloadProtyle(item.editor.protyle, false); + reloadProtyle(item.editor.protyle, false, true); updateTitle(item.editor.protyle.block.rootID, item.parent, item.editor.protyle); }); } else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) { diff --git a/app/src/protyle/scroll/saveScroll.ts b/app/src/protyle/scroll/saveScroll.ts index 133898762..48dc2803a 100644 --- a/app/src/protyle/scroll/saveScroll.ts +++ b/app/src/protyle/scroll/saveScroll.ts @@ -48,7 +48,8 @@ export const getDocByScroll = (options: { scrollAttr: IScrollAttr, mergedOptions?: IOptions, cb?: () => void - focus?: boolean + focus?: boolean, + updateReadonly?: boolean }) => { let actions: string[] = []; if (options.mergedOptions) { @@ -80,7 +81,8 @@ export const getDocByScroll = (options: { protyle: options.protyle, action: actions, scrollAttr: options.scrollAttr, - afterCB: options.cb + afterCB: options.cb, + updateReadonly: options.updateReadonly }); }); } else { @@ -90,7 +92,8 @@ export const getDocByScroll = (options: { protyle: options.protyle, action: actions, scrollAttr: options.scrollAttr, - afterCB: options.cb + afterCB: options.cb, + updateReadonly: options.updateReadonly }); } }); @@ -109,7 +112,8 @@ export const getDocByScroll = (options: { protyle: options.protyle, action: actions, scrollAttr: options.scrollAttr, - afterCB: options.cb + afterCB: options.cb, + updateReadonly: options.updateReadonly }); }); }; diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts index 8768431d8..57b46a505 100644 --- a/app/src/protyle/util/reload.ts +++ b/app/src/protyle/util/reload.ts @@ -5,7 +5,7 @@ import {renderBacklink} from "../wysiwyg/renderBacklink"; import {hasClosestByClassName} from "./hasClosest"; import {preventScroll} from "../scroll/preventScroll"; -export const reloadProtyle = (protyle: IProtyle, focus: boolean) => { +export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?: boolean) => { if (!protyle.preview.element.classList.contains("fn__none")) { protyle.preview.render(protyle); return; @@ -51,7 +51,8 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean) => { getDocByScroll({ protyle, focus, - scrollAttr: saveScroll(protyle, true) + scrollAttr: saveScroll(protyle, true), + updateReadonly }); } };