fix settings open

This commit is contained in:
cupcakearmy 2021-05-28 20:54:56 +02:00
parent 3129030d00
commit f5ecebb61a
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

View File

@ -64,7 +64,7 @@ export default class Settings {
static open() { static open() {
if (this.win) return if (this.win) return
Settings.win = new BrowserWindow({ this.win = new BrowserWindow({
width: 400, width: 400,
height: 630, height: 630,
center: true, center: true,
@ -74,20 +74,21 @@ export default class Settings {
contextIsolation: false, contextIsolation: false,
}, },
}) })
this.win.on('closed', () => (this.win = null))
const entry = join(__dirname, '../front/settings/index.html') const entry = join(__dirname, '../front/settings/index.html')
Settings.win.loadFile(entry) this.win.loadFile(entry)
Settings.win.setMenu(null) this.win.setMenu(null)
if (DEV) { if (DEV) {
Settings.win.setSize(800, 485) this.win.setSize(800, 485)
Settings.win.setResizable(true) this.win.setResizable(true)
Settings.win.webContents.openDevTools() this.win.webContents.openDevTools()
} }
} }
static getStatus(): [boolean, number] { static getStatus(): [boolean, number] {
const paused: number = Settings.load('paused') const paused: number = this.load('paused')
const now = Date.now() const now = Date.now()
if (paused > now) { if (paused > now) {
return [true, paused - now] return [true, paused - now]