Skip to content

Commit be40435

Browse files
committed
Added confirmation dialog on app exit
1 parent cb0c195 commit be40435

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/dialog.js

+15
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ class Dialog {
3636
);
3737
}
3838

39+
_exit() {
40+
return this._create({
41+
buttons: ['Exit', 'Dismiss'],
42+
detail: 'Are you sure you want to exit?',
43+
message: 'Exit Ao',
44+
title: 'Ao - Exit Confirmation'
45+
});
46+
}
47+
3948
_signOut() {
4049
return this._create({
4150
buttons: ['Sign Out', 'Dismiss'],
@@ -69,6 +78,12 @@ class Dialog {
6978
}
7079
}
7180

81+
confirmExit() {
82+
if (this._exit() === 0) {
83+
app.quit();
84+
}
85+
}
86+
7287
confirmRestart() {
7388
if (this._restart() === 0) {
7489
app.quit();

0 commit comments

Comments
 (0)