Made sure settingsWindow exists before operating on it. fixes #344

This commit is contained in:
Rick van Lieshout 2024-02-12 22:37:03 +01:00
parent 10a4af8e90
commit 49bc737485
2 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed chromium mediaSession instance showing up. fixes #338 #198 - Fixed chromium mediaSession instance showing up. fixes #338 #198
- Set a new icon, should fix #302 - Set a new icon, should fix #302
- Made sure settingsWindow exists before operating on it. fixes #344
## [5.8.0] ## [5.8.0]

View File

@ -138,6 +138,10 @@ export const createSettingsWindow = function () {
}; };
export const showSettingsWindow = function (tab = "general") { export const showSettingsWindow = function (tab = "general") {
if (!settingsWindow) {
console.log("Settings window is not initialized. Attempting to create it.");
createSettingsWindow();
}
settingsWindow.webContents.send("goToTab", tab); settingsWindow.webContents.send("goToTab", tab);
// refresh data just before showing the window // refresh data just before showing the window