mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 10:51:02 +00:00
refactor ternary to if statement in window-manager, update constant definitions for better clarity
This commit is contained in:
@@ -27,7 +27,7 @@ export class UserPreferences {
|
||||
telemetryEnabled: boolean;
|
||||
|
||||
@Column("boolean", { default: false })
|
||||
quitInXButtonEnabled: boolean;
|
||||
preferQuitInsteadOfHiding: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user