Skip to content

Commit

Permalink
Fixed dialog and caught rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Hi-Ray committed Sep 10, 2019
1 parent 81ef3f5 commit 791de2a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
});

0 comments on commit 791de2a

Please sign in to comment.