moved from before-quit to close
This commit is contained in:
parent
a15d1f88e7
commit
cb18c1c098
1 changed files with 6 additions and 5 deletions
|
@ -894,11 +894,7 @@ export class BrowserWindow {
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('before-quit', () => {
|
app.on('before-quit', () => {
|
||||||
BrowserWindow.win.webContents.executeJavaScript(`
|
|
||||||
window.localStorage.setItem("currentTrack", JSON.stringify(app.mk.nowPlayingItem));
|
|
||||||
window.localStorage.setItem("currentTime", JSON.stringify(app.mk.currentPlaybackTime));
|
|
||||||
window.localStorage.setItem("currentQueue", JSON.stringify(app.mk.queue.items));
|
|
||||||
ipcRenderer.send('stopGCast','');`)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -1131,6 +1127,11 @@ export class BrowserWindow {
|
||||||
let isQuiting = false
|
let isQuiting = false
|
||||||
|
|
||||||
BrowserWindow.win.on("close", (event: Event) => {
|
BrowserWindow.win.on("close", (event: Event) => {
|
||||||
|
BrowserWindow.win.webContents.executeJavaScript(`
|
||||||
|
window.localStorage.setItem("currentTrack", JSON.stringify(app.mk.nowPlayingItem));
|
||||||
|
window.localStorage.setItem("currentTime", JSON.stringify(app.mk.currentPlaybackTime));
|
||||||
|
window.localStorage.setItem("currentQueue", JSON.stringify(app.mk.queue.items));
|
||||||
|
ipcRenderer.send('stopGCast','');`)
|
||||||
if ((utils.getStoreValue('general.close_button_hide') || process.platform === "darwin") && !isQuiting) {
|
if ((utils.getStoreValue('general.close_button_hide') || process.platform === "darwin") && !isQuiting) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
BrowserWindow.win.hide();
|
BrowserWindow.win.hide();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue