diff options
Diffstat (limited to 'src/main/manaplus/manaplus.ts')
-rw-r--r-- | src/main/manaplus/manaplus.ts | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/main/manaplus/manaplus.ts b/src/main/manaplus/manaplus.ts index 96cbbd3..08ea0fc 100644 --- a/src/main/manaplus/manaplus.ts +++ b/src/main/manaplus/manaplus.ts @@ -129,7 +129,7 @@ ipcMain.on("getScreenshots", (event: any, arg: string) => { }); EventEmitter.on("Mana:openScreenshotDir", () => { - shell.openItem( + shell.openPath( join(getUserDataPath(), `/screenshots/${CurrentServer.address}/`) ); }); @@ -177,7 +177,7 @@ function runManaProgram( gameExe: string, server?: string ): Promise<any> { - return new Promise(async (resolve, reject) => { + return new Promise<void>(async (resolve, reject) => { if (server) { Status.setActivity(`Preparing Launch`); await setSkipUpdateWindows(server); @@ -220,17 +220,9 @@ async function updateDialog(newestVersion: string): Promise<boolean> { "Do you want to update now? Please note that you'll have to update eventually to ensure further compability with the servers", buttons: ["Nah, LATER", "Update NOW"], }; - let dialog = await dialogPromiseWrapper(options); - console.log("....", dialog); - return dialog === 1; -} - -function dialogPromiseWrapper(options: any): Promise<number> { - return new Promise((res, rej) => { - dialog.showMessageBox(options, (index) => { - res(index); - }); - }); + let { response } = await dialog.showMessageBox(null, options); + console.log("....", response); + return response === 1; } const default_server_config = |