Skip to content

Commit

Permalink
Added sign-out confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed Apr 22, 2018
1 parent d9c175e commit 1103dcc
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,23 @@ function requestAppRestart() {
}
}

function confirmSignOut() {
// Display sign-out confirmation dialog
const result = dialog.showMessageBox({
icon: path.join(__dirname, 'static/Icon.png'),
title: 'Sign out Confirmation',
message: 'Sign out of Ao',
detail: 'Are you sure you want to sign out?',
buttons: ['Sign out', 'Dismiss'],
defaultId: 0, // Make `Sign out` the default action button
cancelId: 1
});
// Check whether the sign-out button was pressed
if (result === 0) {
activate('sign-out');
}
}

const helpSubmenu = [{
label: `View License`,
click() {
Expand Down Expand Up @@ -437,7 +454,7 @@ const darwinTpl = [{
label: 'Sign out',
accelerator: setAcc('sign-out', 'CmdorCtrl+Alt+Q'),
click() {
activate('sign-out');
confirmSignOut();
}
}]
}, {
Expand Down Expand Up @@ -764,7 +781,7 @@ const otherTpl = [{
label: 'Sign out',
accelerator: setAcc('sign-out', 'CmdorCtrl+Alt+Q'),
click() {
activate('sign-out');
confirmSignOut();
}
}, {
type: 'separator'
Expand Down

0 comments on commit 1103dcc

Please sign in to comment.