Skip to content

Commit

Permalink
Added confirmation dialog on app exit
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed Dec 22, 2018
1 parent cb0c195 commit be40435
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/dialog.js
Expand Up @@ -36,6 +36,15 @@ class Dialog {
);
}

_exit() {
return this._create({
buttons: ['Exit', 'Dismiss'],
detail: 'Are you sure you want to exit?',
message: 'Exit Ao',
title: 'Ao - Exit Confirmation'
});
}

_signOut() {
return this._create({
buttons: ['Sign Out', 'Dismiss'],
Expand Down Expand Up @@ -69,6 +78,12 @@ class Dialog {
}
}

confirmExit() {
if (this._exit() === 0) {
app.quit();
}
}

confirmRestart() {
if (this._restart() === 0) {
app.quit();
Expand Down

0 comments on commit be40435

Please sign in to comment.