autoplay persists on app launches

This commit is contained in:
Core 2022-09-21 23:58:39 +01:00
parent 9f4d26f29e
commit 6e048db633
No known key found for this signature in database
GPG key ID: 2AB8327FBA02D1C0
2 changed files with 21 additions and 0 deletions

View file

@ -231,6 +231,11 @@ export class Store {
settings: false,
},
},
musickit: {
"stored-attributes": {
autoplayEnabled: "",
},
},
};
private migrations: any = {};
private schema: ElectronStore.Schema<any> = {

View file

@ -292,6 +292,21 @@ const app = new Vue({
setWindowHash(route = "") {
window.location.hash = `#${route}`;
},
monitorMusickit() {
if (!app.cfg.musickit) return;
for (const [attr, value] of Object.entries(app.cfg.musickit["stored-attributes"])) {
console.log(`Musickit value: ` + app.mk[attr]);
console.log(`Config value: ` + value);
if (value !== "" && app.mk[attr] !== value) {
app.mk[attr] = value;
}
this.$watch(`mk.${attr}`, (val) => {
console.log(`MK ${attr} changed to ${val}`);
app.cfg.musickit["stored-attributes"][attr] = val;
});
}
},
async oobeInit() {
this.appMode = "oobe";
for (const [k, v] of Object.entries(ipcRenderer.sendSync("get-i18n-listing"))) {
@ -826,6 +841,7 @@ const app = new Vue({
};
}
MusicKitInterop.init();
this.monitorMusickit();
// Set the volume
// Check the value of this.cfg.audio.muted