Vanessa 2024-09-27 00:21:31 +08:00
parent 459b700e26
commit c33e9429cd
8 changed files with 38 additions and 25 deletions

View file

@ -48,7 +48,7 @@ const focusStack = async (app: App, stack: IBackStack) => {
title: info.data.rootTitle,
docIcon: info.data.rootIcon,
callback(tab) {
const scrollAttr = saveScroll(stack.protyle, true);
const scrollAttr = saveScroll(stack.protyle, true) as IScrollAttr;
scrollAttr.rootId = stack.protyle.block.rootID;
scrollAttr.focusId = stack.id;
scrollAttr.focusStart = stack.position.start;

View file

@ -24,18 +24,30 @@ export const processMessage = (response: IWebSocketData) => {
if ("reloadui" === response.cmd) {
if (response.data?.resetScroll) {
window.siyuan.storage[Constants.LOCAL_FILEPOSITION] = {};
setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION]);
}
/// #if MOBILE
window.location.reload();
/// #else
exportLayout({
cb() {
setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION], () => {
/// #if MOBILE
window.location.reload();
},
errorExit: false,
});
/// #endif
/// #else
exportLayout({
cb() {
window.location.reload();
},
errorExit: false,
});
/// #endif
});
} else {
/// #if MOBILE
window.location.reload();
/// #else
exportLayout({
cb() {
window.location.reload();
},
errorExit: false,
});
/// #endif
}
return false;
}