From a912ded035f0ee64ffb250badd6c2726ac08c0a7 Mon Sep 17 00:00:00 2001 From: Ian Carder <0lies18pies@gmail.com> Date: Tue, 13 Aug 2024 08:46:46 -0400 Subject: [PATCH] Add confirmation box prior to the client closing --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 1055328..079a8ec 100644 --- a/index.js +++ b/index.js @@ -166,4 +166,11 @@ function showMainWindow() { app.quit(); } }); + + mainWindow.on('close',function(e){ + var choice = dialog.showMessageBox({"type":'question','buttons':['Yes','No'],'title':'Confirm','message':'Are you sure you want to close the client?'}); + if(choice == 1){ + e.preventDefault(); + } + }); }