Vanessa 2025-10-24 13:18:10 +08:00
parent 5ec6b314a9
commit 918f679a31
2 changed files with 7 additions and 7 deletions

View file

@ -57,9 +57,6 @@ export const openFileById = async (options: {
return;
}
// 更新文档浏览时间
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: response.data.rootID});
return openFile({
app: options.app,
fileName: response.data.rootTitle,

View file

@ -43,6 +43,8 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
pushBack();
scrollCenter(window.siyuan.mobile.editor.protyle, blockElement, true);
closePanel();
// 更新文档浏览时间
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: window.siyuan.mobile.editor.protyle.block.rootID});
return;
}
}
@ -52,9 +54,6 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
showMessage(data.msg);
return;
}
// 更新文档浏览时间
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: data.data.rootID});
const protyleOptions: IProtyleOptions = {
blockId: id,
rootId: data.data.rootID,
@ -77,6 +76,9 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
addLoading(window.siyuan.mobile.editor.protyle);
if (window.siyuan.mobile.editor.protyle.block.rootID !== data.data.rootID) {
window.siyuan.mobile.editor.protyle.wysiwyg.element.innerHTML = "";
fetchPost("/api/storage/updateRecentDocOpenTime", {rootID: data.data.rootID});
} else {
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: data.data.rootID});
}
if (action.includes(Constants.CB_GET_SCROLL) && window.siyuan.storage[Constants.LOCAL_FILEPOSITION][data.data.rootID]) {
getDocByScroll({
@ -109,6 +111,7 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
}
window.siyuan.mobile.editor.protyle.undo.clear();
} else {
fetchPost("/api/storage/updateRecentDocOpenTime", {rootID: data.data.rootID});
window.siyuan.mobile.editor = new Protyle(app, document.getElementById("editor"), protyleOptions);
}
setEditor();