mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-29 11:46:09 +01:00
This commit is contained in:
parent
c099f3be2e
commit
367c2f4d18
3 changed files with 36 additions and 26 deletions
|
|
@ -128,30 +128,6 @@ export const initFramework = () => {
|
|||
closePanel();
|
||||
});
|
||||
initEditorName();
|
||||
if (getOpenNotebookCount() > 0) {
|
||||
const openId = getSearch("id");
|
||||
if (openId) {
|
||||
openMobileFileById(openId,
|
||||
getSearch("focus") === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
||||
} else {
|
||||
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
|
||||
fetchPost("/api/block/checkBlockExist", {id: localDoc.id}, existResponse => {
|
||||
if (existResponse.data) {
|
||||
openMobileFileById(localDoc.id, localDoc.action);
|
||||
} else {
|
||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||
if (response.data.length !== 0) {
|
||||
openMobileFileById(response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
|
||||
} else {
|
||||
setEmpty();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setEmpty();
|
||||
}
|
||||
if (window.siyuan.config.newbie) {
|
||||
mountHelp();
|
||||
}
|
||||
|
|
@ -160,6 +136,36 @@ export const initFramework = () => {
|
|||
transactionTipElement.querySelector(".b3-button").addEventListener(getEventName(), () => {
|
||||
syncGuide();
|
||||
});
|
||||
if (getOpenNotebookCount() > 0) {
|
||||
const openURL = window.JSAndroid.getBlockURL();
|
||||
if (openURL && !/^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(openURL)) {
|
||||
openMobileFileById(openURL.substr(16, 22),
|
||||
getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
||||
return;
|
||||
}
|
||||
const openId = getSearch("id");
|
||||
if (openId) {
|
||||
openMobileFileById(openId,
|
||||
getSearch("focus") === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
||||
return;
|
||||
}
|
||||
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
|
||||
fetchPost("/api/block/checkBlockExist", {id: localDoc.id}, existResponse => {
|
||||
if (existResponse.data) {
|
||||
openMobileFileById(localDoc.id, localDoc.action);
|
||||
} else {
|
||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||
if (response.data.length !== 0) {
|
||||
openMobileFileById(response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
|
||||
} else {
|
||||
setEmpty();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
setEmpty();
|
||||
};
|
||||
|
||||
const initEditorName = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue