mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
This commit is contained in:
parent
5ec6b314a9
commit
918f679a31
2 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue