mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-12 11:12:07 +00:00
get userPreferences moved to close event
This commit is contained in:
parent
5fda06477d
commit
58f58d0c63
2 changed files with 552 additions and 404 deletions
|
@ -26,7 +26,7 @@ export class WindowManager {
|
|||
}
|
||||
}
|
||||
|
||||
public static async createMainWindow() {
|
||||
public static createMainWindow() {
|
||||
// Create the browser window.
|
||||
this.mainWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
|
@ -50,15 +50,15 @@ export class WindowManager {
|
|||
this.loadURL();
|
||||
this.mainWindow.removeMenu();
|
||||
|
||||
const userPreferences = await userPreferencesRepository.findOne({
|
||||
where: { id: 1 },
|
||||
});
|
||||
|
||||
this.mainWindow.on("ready-to-show", () => {
|
||||
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
|
||||
});
|
||||
|
||||
this.mainWindow.on("close", () => {
|
||||
this.mainWindow.on("close", async () => {
|
||||
const userPreferences = await userPreferencesRepository.findOne({
|
||||
where: { id: 1 },
|
||||
});
|
||||
|
||||
if (userPreferences?.preferQuitInsteadOfHiding) {
|
||||
app.quit();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue