Update browserwindow.ts
This commit is contained in:
parent
cb18c1c098
commit
49633ab255
1 changed files with 5 additions and 5 deletions
|
@ -1127,15 +1127,15 @@ 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();
|
||||||
} else {
|
} else {
|
||||||
|
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','');`)
|
||||||
BrowserWindow.win.destroy();
|
BrowserWindow.win.destroy();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue