refactor ternary to if statement in window-manager, update constant definitions for better clarity

This commit is contained in:
Hachi-R 2024-05-03 14:58:45 -03:00
parent 94b7c8aefe
commit 315d03ae69
6 changed files with 18 additions and 12 deletions

View file

@ -51,11 +51,14 @@ export class WindowManager {
this.mainWindow.removeMenu();
const userPreferences = await userPreferencesRepository.findOne({
where: {id: 1},
where: { id: 1 },
});
this.mainWindow.on("close", () => {
userPreferences?.quitInXButtonEnabled ? app.quit() : WindowManager.mainWindow?.setProgressBar(-1);
if (userPreferences?.preferQuitInsteadOfHiding) {
app.quit();
}
WindowManager.mainWindow?.setProgressBar(-1);
});
}