新增单例应用功能
parent
0586639e07
commit
da764721d9
|
@ -1,3 +1,7 @@
|
|||
### 新增
|
||||
|
||||
- 新增单例应用功能
|
||||
|
||||
### 优化
|
||||
|
||||
- 优化歌单列表动画
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
const { app, BrowserWindow, Menu } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
// 单例应用程序
|
||||
if (!app.requestSingleInstanceLock()) {
|
||||
app.quit()
|
||||
return
|
||||
}
|
||||
app.on('second-instance', (event, argv, cwd) => {
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
mainWindow.focus()
|
||||
} else {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
require('./events')
|
||||
const progressBar = require('./events/progressBar')
|
||||
const trafficLight = require('./events/trafficLight')
|
||||
|
@ -90,4 +104,3 @@ app.on('activate', () => {
|
|||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue