mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
refactor: move all states+actions inside player.vue to Player.js
This commit is contained in:
parent
5355caa4e4
commit
fab0227ed3
6 changed files with 187 additions and 205 deletions
12
src/App.vue
12
src/App.vue
|
|
@ -46,7 +46,7 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["showLyrics"]),
|
||||
...mapState(["showLyrics", "showLibraryDefault", "player"]),
|
||||
isAccountLoggedIn() {
|
||||
return isAccountLoggedIn();
|
||||
},
|
||||
|
|
@ -62,18 +62,14 @@ export default {
|
|||
);
|
||||
},
|
||||
enablePlayer() {
|
||||
return (
|
||||
this.$store.state.player.enabled &&
|
||||
this.$route.name !== "lastfmCallback"
|
||||
);
|
||||
return this.player.enabled && this.$route.name !== "lastfmCallback";
|
||||
},
|
||||
showNavbar() {
|
||||
return this.$route.name !== "lastfmCallback";
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$store.state.settings.showLibraryDefault &&
|
||||
this.$router.push("/library");
|
||||
this.showLibraryDefault && this.$router.push("/library");
|
||||
if (this.isElectron) {
|
||||
ipcRenderer(this);
|
||||
}
|
||||
|
|
@ -85,7 +81,7 @@ export default {
|
|||
if (e.target.tagName === "INPUT") return false;
|
||||
if (this.$route.name === "mv") return false;
|
||||
e.preventDefault();
|
||||
this.$refs.player.play();
|
||||
this.player.play();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue