Commit 8a2cbf64 authored by ransome1's avatar ransome1
Browse files

Fixed issue on reopening window after being closed on MacOS

parent 3852120a
{
"name": "sleek",
"productName": "sleek",
"version": "1.0.6-2",
"version": "1.0.6-3",
"description": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"synopsis": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"category": "ProjectManagement",
......
......@@ -84,6 +84,7 @@ if(process.platform === "win32") trayIcon = path.join(appData.path, "../assets/i
// ########################################################################################################################
// CREATE THE WINDOW
// ########################################################################################################################
let mainWindow = null;
const createWindow = async function() {
const getContent = function(file) {
try {
......@@ -323,7 +324,7 @@ const createWindow = async function() {
userData = await getUserData();
translations = await getTranslations(userData.data.language);
console.log("Success: Translation loaded for: " + userData.data.language);
const mainWindow = new BrowserWindow({
mainWindow = new BrowserWindow({
width: userData.data.width,
height: userData.data.height,
x: userData.data.horizontal,
......@@ -678,7 +679,7 @@ const createWindow = async function() {
if(args[0]) clipboard.writeText(args[0], "selection")
})
.on("update-badge", (event, count) => {
if(appData.os === "mac") app.setBadgeCount(count);
if(appData.os==="mac") app.setBadgeCount(count);
})
.on("restart", () => {
app.relaunch();
......@@ -722,6 +723,7 @@ app
})
.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit()
mainWindow = null;
})
.on("activate", () => {
if (BrowserWindow.getAllWindows().length===0) createWindow()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment