From f5ecebb61a8cfed8856eebd2826a065e4408fe09 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Fri, 28 May 2021 20:54:56 +0200 Subject: [PATCH] fix settings open --- src/back/settings.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/back/settings.ts b/src/back/settings.ts index 18682aa..45d4f95 100644 --- a/src/back/settings.ts +++ b/src/back/settings.ts @@ -64,7 +64,7 @@ export default class Settings { static open() { if (this.win) return - Settings.win = new BrowserWindow({ + this.win = new BrowserWindow({ width: 400, height: 630, center: true, @@ -74,20 +74,21 @@ export default class Settings { contextIsolation: false, }, }) + this.win.on('closed', () => (this.win = null)) const entry = join(__dirname, '../front/settings/index.html') - Settings.win.loadFile(entry) - Settings.win.setMenu(null) + this.win.loadFile(entry) + this.win.setMenu(null) if (DEV) { - Settings.win.setSize(800, 485) - Settings.win.setResizable(true) - Settings.win.webContents.openDevTools() + this.win.setSize(800, 485) + this.win.setResizable(true) + this.win.webContents.openDevTools() } } static getStatus(): [boolean, number] { - const paused: number = Settings.load('paused') + const paused: number = this.load('paused') const now = Date.now() if (paused > now) { return [true, paused - now]