From 791de2aabe562d16aef91b5ab098b559c82937b1 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 10 Sep 2019 11:50:42 +0100 Subject: [PATCH] Fixed dialog and caught rpc --- app.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index a4ecd55..23ff3b9 100644 --- a/app.js +++ b/app.js @@ -76,12 +76,13 @@ app.on('ready', () => { } await duplicateSystemYaml(); - const response = dialog.showMessageBox({ + const response = dialog.showMessageBoxSync({ type: 'info', buttons: [ 'Cancel', 'Ok' ], title: 'Rift Explorer', message: 'Rift Explorer needs to restart your League of Legends client to work properly', cancelId: 0, + noLink: true }); if (!response) { @@ -116,25 +117,27 @@ app.on('ready', () => { largeImageKey: 'rift', largeImageText: 'Rift Explorer', instance: false, - }); + }).catch(console.error); } rpc.on('ready', () => { - setActivity(); + setActivity().catch(console.error); // activity can only be set every 15 seconds setInterval(() => { - setActivity(); + setActivity().catch(console.error); }, 15e3); }); + rpc.on('error', console.error); + connector.start(); rpc.login({ clientId }).catch(console.error); }); app.on('window-all-closed', () => { if (process.platform !== 'darwin') { + rpc.destroy().catch(console.error); app.quit(); } - rpc.destroy(); });