diff --git a/app/src/mobile/util/onMessage.ts b/app/src/mobile/util/onMessage.ts index 73554fede..54e62ff56 100644 --- a/app/src/mobile/util/onMessage.ts +++ b/app/src/mobile/util/onMessage.ts @@ -33,7 +33,6 @@ export const onMessage = (data: IWebSocketData) => { document.getElementById("toolbarSync").classList.add("fn__none"); } break; - case "create": case "createdailynote": openMobileFileById(data.data.id); break; diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts index 77f7044ec..e92b4c46a 100644 --- a/app/src/util/newFile.ts +++ b/app/src/util/newFile.ts @@ -83,6 +83,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin }, response => { /// #if !MOBILE 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 }); } else { @@ -97,6 +99,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin }, response => { /// #if !MOBILE 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 }); }); @@ -121,6 +125,8 @@ export const newFile = (notebookId?: string, currentPath?: string, paths?: strin }, () => { /// #if !MOBILE openFileById({id, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); + /// #else + openMobileFileById(id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]); /// #endif }); } @@ -165,11 +171,11 @@ export const newFileByName = (value: string) => { markdown: "" }, response => { hideElements(["dialog"]); - if (isMobile()) { - openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]); - } else { - openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); - } + /// #if MOBILE + openMobileFileById(response.data, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]); + /// #else + openFileById({id: response.data, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]}); + /// #endif }); }); };