Fix behaviour when closed

This commit is contained in:
smartfridge 2021-05-05 10:48:13 +02:00
parent 1c55ed7335
commit cd5f9ee4db

View file

@ -38,6 +38,7 @@ function createWindow() {
{ {
label: "Support Discord Server", label: "Support Discord Server",
click: function () { click: function () {
mainWindow.show();
mainWindow.loadURL("https://discord.gg/F25bc4RYDt"); mainWindow.loadURL("https://discord.gg/F25bc4RYDt");
}, },
}, },
@ -54,15 +55,13 @@ function createWindow() {
// Emitted when the window is closed. // Emitted when the window is closed.
mainWindow.on("close", function (event) { mainWindow.on("close", function (event) {
mainWindow = null;
});
mainWindow.on("minimize", function (event) {
event.preventDefault(); event.preventDefault();
mainWindow.hide(); mainWindow.hide();
}); });
mainWindow.on("show", function () { mainWindow.on("show", function () {
//gives some error todo
appIcon.setHighlightMode("always"); appIcon.setHighlightMode("always");
}); });
} }