(MacOS)
Using this:
win.on("close", () => {
if (confirm("close window?")) {
win.close(true);
}
});
If I confirm close, app closes fine. If I don't confirm, I am no longer able to close the app, I need to force quit. I tried to re-attach the listener:
win.on("close", () => {
handleWinClose();
});
function handleWinClose() {
if (confirm("close window?")) {
win.close(true);
} else {
win.on("close", () => {
handleWinClose();
});
}
};
but it doesn't help. Apparently the "close" event is only fired once, ever. Any workaround for this?
(MacOS)
Using this:
If I confirm close, app closes fine. If I don't confirm, I am no longer able to close the app, I need to force quit. I tried to re-attach the listener:
but it doesn't help. Apparently the "close" event is only fired once, ever. Any workaround for this?