Moved localstorage saves and gcast to on close

This commit is contained in:
Core 2022-08-16 02:04:33 +01:00
parent 4804c2bbf4
commit 746e96e33a
No known key found for this signature in database
GPG key ID: 2AB8327FBA02D1C0

View file

@ -1444,15 +1444,13 @@ export class BrowserWindow {
if ((process.platform === "darwin" || utils.getStoreValue("general.close_button_hide")) && !isQuitting) {
e.preventDefault();
win.hide();
}
});
win.on("closed", (_: any) => {
} else {
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._unplayedQueueItems));
ipcRenderer.send('stopGCast','');`);
}
});
app.on("before-quit", () => {