mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
get userPreferences moved to close event
This commit is contained in:
parent
5fda06477d
commit
58f58d0c63
@ -26,7 +26,7 @@ export class WindowManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async createMainWindow() {
|
public static createMainWindow() {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
this.mainWindow = new BrowserWindow({
|
this.mainWindow = new BrowserWindow({
|
||||||
width: 1200,
|
width: 1200,
|
||||||
@ -50,15 +50,15 @@ export class WindowManager {
|
|||||||
this.loadURL();
|
this.loadURL();
|
||||||
this.mainWindow.removeMenu();
|
this.mainWindow.removeMenu();
|
||||||
|
|
||||||
const userPreferences = await userPreferencesRepository.findOne({
|
|
||||||
where: { id: 1 },
|
|
||||||
});
|
|
||||||
|
|
||||||
this.mainWindow.on("ready-to-show", () => {
|
this.mainWindow.on("ready-to-show", () => {
|
||||||
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
|
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) {
|
if (userPreferences?.preferQuitInsteadOfHiding) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user