chore: Prettified Code

[ci skip]
This commit is contained in:
yazninja 2023-05-12 18:00:01 +00:00 committed by cider-chore[bot]
parent 658239ed5f
commit c2331869f0
2 changed files with 4 additions and 9 deletions

View file

@ -1407,7 +1407,6 @@ export class BrowserWindow {
shell.openExternal(String(utils.getStoreValue("cc_authURL"))); shell.openExternal(String(utils.getStoreValue("cc_authURL")));
}); });
ipcMain.on("auth-window", (_event) => { ipcMain.on("auth-window", (_event) => {
AuthWindow(BrowserWindow.win); AuthWindow(BrowserWindow.win);
}); });

View file

@ -354,14 +354,13 @@ const app = new Vue({
document.querySelector("#LOADER").remove(); document.querySelector("#LOADER").remove();
ipcRenderer.on("recv-cookies", function (_event, cookies) { ipcRenderer.on("recv-cookies", function (_event, cookies) {
console.log('[appIPC] recv-cookies'); console.log("[appIPC] recv-cookies");
Object.keys(cookies).forEach((key) => { Object.keys(cookies).forEach((key) => {
localStorage.setItem(key, cookies[key]); localStorage.setItem(key, cookies[key]);
}); });
localStorage.setItem("seenOOBE", 1); localStorage.setItem("seenOOBE", 1);
window.location.reload(); window.location.reload();
}); });
}, },
getAppStyle() { getAppStyle() {
let finalStyle = {}; let finalStyle = {};
@ -410,7 +409,7 @@ const app = new Vue({
if (val) { if (val) {
this.mk.isAuthorized ? (this.chrome.menuOpened = !this.chrome.menuOpened) : false; this.mk.isAuthorized ? (this.chrome.menuOpened = !this.chrome.menuOpened) : false;
if (!this.mk.isAuthorized) { if (!this.mk.isAuthorized) {
ipcRenderer.send("auth-window") ipcRenderer.send("auth-window");
} }
} else { } else {
setTimeout(() => { setTimeout(() => {
@ -840,14 +839,12 @@ const app = new Vue({
this.chrome.nativeControls = true; this.chrome.nativeControls = true;
} }
this.setLz(this.cfg.general.language); this.setLz(this.cfg.general.language);
this.setLzManual(); this.setLzManual();
clearTimeout(this.hangtimer); clearTimeout(this.hangtimer);
this.mk = MusicKit.getInstance(); this.mk = MusicKit.getInstance();
let needsReload = typeof localStorage["music.ampwebplay.media-user-token"] == "undefined"; let needsReload = typeof localStorage["music.ampwebplay.media-user-token"] == "undefined";
if(needsReload) { if (needsReload) {
ipcRenderer.send("auth-window"); ipcRenderer.send("auth-window");
this.mkIsReady = true; this.mkIsReady = true;
} }
@ -1091,7 +1088,6 @@ const app = new Vue({
} }
}); });
this.mk.addEventListener(MusicKit.Events.playbackStateDidChange, (event) => { this.mk.addEventListener(MusicKit.Events.playbackStateDidChange, (event) => {
ipcRenderer.send("wsapi-updatePlaybackState", wsapi.getAttributes()); ipcRenderer.send("wsapi-updatePlaybackState", wsapi.getAttributes());
document.body.setAttribute("playback-state", event.state == 2 ? "playing" : "paused"); document.body.setAttribute("playback-state", event.state == 2 ? "playing" : "paused");