mirror of
https://github.com/cupcakearmy/unpixel.git
synced 2024-12-22 08:06:33 +00:00
fix settings open
This commit is contained in:
parent
3129030d00
commit
f5ecebb61a
@ -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]
|
||||||
|
Loading…
Reference in New Issue
Block a user