Skip to content

Commit 918f679

Browse files
committed
🎨 #15824
1 parent 5ec6b31 commit 918f679

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/src/editor/util.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ export const openFileById = async (options: {
5656
showMessage(response.msg);
5757
return;
5858
}
59-
60-
// 更新文档浏览时间
61-
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: response.data.rootID});
62-
59+
6360
return openFile({
6461
app: options.app,
6562
fileName: response.data.rootTitle,

app/src/mobile/editor.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
4343
pushBack();
4444
scrollCenter(window.siyuan.mobile.editor.protyle, blockElement, true);
4545
closePanel();
46+
// 更新文档浏览时间
47+
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: window.siyuan.mobile.editor.protyle.block.rootID});
4648
return;
4749
}
4850
}
@@ -52,9 +54,6 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
5254
showMessage(data.msg);
5355
return;
5456
}
55-
56-
// 更新文档浏览时间
57-
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: data.data.rootID});
5857
const protyleOptions: IProtyleOptions = {
5958
blockId: id,
6059
rootId: data.data.rootID,
@@ -77,6 +76,9 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
7776
addLoading(window.siyuan.mobile.editor.protyle);
7877
if (window.siyuan.mobile.editor.protyle.block.rootID !== data.data.rootID) {
7978
window.siyuan.mobile.editor.protyle.wysiwyg.element.innerHTML = "";
79+
fetchPost("/api/storage/updateRecentDocOpenTime", {rootID: data.data.rootID});
80+
} else {
81+
fetchPost("/api/storage/updateRecentDocViewTime", {rootID: data.data.rootID});
8082
}
8183
if (action.includes(Constants.CB_GET_SCROLL) && window.siyuan.storage[Constants.LOCAL_FILEPOSITION][data.data.rootID]) {
8284
getDocByScroll({
@@ -109,6 +111,7 @@ export const openMobileFileById = (app: App, id: string, action: TProtyleAction[
109111
}
110112
window.siyuan.mobile.editor.protyle.undo.clear();
111113
} else {
114+
fetchPost("/api/storage/updateRecentDocOpenTime", {rootID: data.data.rootID});
112115
window.siyuan.mobile.editor = new Protyle(app, document.getElementById("editor"), protyleOptions);
113116
}
114117
setEditor();

0 commit comments

Comments
 (0)