Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/pull/15824

Vanessa918f679a31e7
diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts
index 1c840181ca..ce96228f64 100644
--- a/app/src/editor/util.ts
+++ b/app/src/editor/util.ts
@@ -56,10 +56,7 @@ export const openFileById = async (options: {
showMessage(response.msg);
return;
}
-
- // 更新文档浏览时间
- fetchPost("/api/storage/updateRecentDocViewTime", {rootID: response.data.rootID});
-
+
return openFile({
app: options.app,
fileName: response.data.rootTitle,
diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.ts
index 2ceddf9f44..28b8722079 100644
--- a/app/src/mobile/editor.ts
+++ b/app/src/mobile/editor.ts
@@ -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();