From 4348ea8329d9a76f14e826f3185d61c2321d7668 Mon Sep 17 00:00:00 2001 From: Arthur Araujo Date: Thu, 4 Jun 2020 20:46:12 -0300 Subject: [PATCH] Fix #255: avoiding preferences save when still null --- changelog.txt | 1 + main.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 784352ad8..03eb8c5f5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -13,6 +13,7 @@ - Fix: [#249] Fix loading preferences - Fix: [#250] Silently ignoring waiver on non-working day or non-working day range - Fix: [#252] Prevent multiple preferences and workday waiver windows to be opened +- Fix: [#255] Avoiding issue when closing preferences window without changing anything - Enhancement: [#228] Improved performance of TTL - Now moving through the calendar is much faster - Enhancement: [#152] Adding a "Copy" option in the "About message", making it easier to copy information when opening an issue - Enhancement: [#247] Day View - new minimalist view that shows the calendar day by day diff --git a/main.js b/main.js index 5e827ab40..428d5fced 100644 --- a/main.js +++ b/main.js @@ -212,8 +212,10 @@ function createWindow() { //prefWindow.webContents.openDevTools() prefWindow.on('close', function() { prefWindow = null; - savePreferences(savedPreferences); - win.webContents.send('PREFERENCE_SAVED', savedPreferences); + if (savedPreferences !== null) { + savePreferences(savedPreferences); + win.webContents.send('PREFERENCE_SAVED', savedPreferences); + } }); }, },