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
1 changed files with 8 additions and 7 deletions

View File

@ -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]