This commit is contained in:
Vanessa 2023-05-06 10:59:23 +08:00
parent b10edbbcb9
commit f9e81c75f2
2 changed files with 11 additions and 6 deletions

View file

@ -33,7 +33,6 @@ export const onMessage = (data: IWebSocketData) => {
document.getElementById("toolbarSync").classList.add("fn__none"); document.getElementById("toolbarSync").classList.add("fn__none");
} }
break; break;
case "create":
case "createdailynote": case "createdailynote":
openMobileFileById(data.data.id); openMobileFileById(data.data.id);
break; break;

View file

@ -83,6 +83,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
}, response => { }, response => {
/// #if !MOBILE /// #if !MOBILE
openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
/// #else
openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif /// #endif
}); });
} else { } else {
@ -97,6 +99,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
}, response => { }, response => {
/// #if !MOBILE /// #if !MOBILE
openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
/// #else
openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif /// #endif
}); });
}); });
@ -121,6 +125,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin
}, () => { }, () => {
/// #if !MOBILE /// #if !MOBILE
openFileById({id, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); openFileById({id, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
/// #else
openMobileFileById(id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
/// #endif /// #endif
}); });
} }
@ -165,11 +171,11 @@ export const newFileByName = (value: string) => {
markdown: "" markdown: ""
}, response => { }, response => {
hideElements(["dialog"]); hideElements(["dialog"]);
if (isMobile()) { /// #if MOBILE
openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]); openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
} else { /// #else
openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});
} /// #endif
}); });
}); });
}; };