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

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

View File

@@ -138,6 +138,10 @@ export const createSettingsWindow = function () {
};
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);
// refresh data just before showing the window