mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-05 15:50:18 +08:00
🐛 Fix(custom): remove listener before unmount
This commit is contained in:
@@ -180,8 +180,8 @@ class LifeCycle {
|
||||
shortKeyHandler.init()
|
||||
})
|
||||
server.startup()
|
||||
startFileServer()
|
||||
webServer.start()
|
||||
startFileServer()
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
handleStartUpFiles(process.argv, process.cwd())
|
||||
}
|
||||
@@ -229,7 +229,7 @@ class LifeCycle {
|
||||
}
|
||||
|
||||
#onRunning () {
|
||||
app.on('second-instance', (event, commandLine, workingDirectory) => {
|
||||
app.on('second-instance', (_, commandLine, workingDirectory) => {
|
||||
logger.info('detect second instance')
|
||||
const result = handleStartUpFiles(commandLine, workingDirectory)
|
||||
if (!result) {
|
||||
|
||||
@@ -11,8 +11,7 @@ class ManageDB {
|
||||
this.#db = new JSONStore(this.#ctx.configPath)
|
||||
let initParams: IStringKeyMap = {
|
||||
picBed: {},
|
||||
settings: {},
|
||||
currentPicBed: 'placeholder'
|
||||
settings: {}
|
||||
}
|
||||
for (let key in initParams) {
|
||||
if (!this.#db.has(key)) {
|
||||
|
||||
@@ -31,7 +31,7 @@ export class ManageApi extends EventEmitter implements ManageApiType {
|
||||
|
||||
constructor (currentPicBed: string = '') {
|
||||
super()
|
||||
this.currentPicBed = currentPicBed || (this.getConfig('currentPicBed') ?? 'placeholder')
|
||||
this.currentPicBed = currentPicBed || 'placeholder'
|
||||
this.configPath = managePathChecker()
|
||||
this.initConfigPath()
|
||||
this.logger = new ManageLogger(this)
|
||||
|
||||
Reference in New Issue
Block a user