Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
await for the router replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Alaanor committed Jun 6, 2020
1 parent d05b385 commit 97db776
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/playlists/local/PlaylistsLocalUnit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ export default Vue.extend({
playlists: get<PlaylistLocal[]>("playlist/playlists"),
},
watch: {
playlists() {
async playlists() {
if (!this.playlist?.path) return;
const hash = PlaylistLibrary.GetByPath(this.playlist.path)?.hash;
if (!hash) return;
if (hash === this.$route.params.hash) return;
this.$router.replace({
await this.$router.replace({
name: route.PLAYLISTS_LOCAL_UNIT,
params: { hash },
});
},
playlist() {
async playlist() {
if (!this.playlist || !this.playlist.hash) return;
if (this.playlist.hash === this.$route.params.hash) return;
this.$router.replace({
await this.$router.replace({
name: route.PLAYLISTS_LOCAL_UNIT,
params: { hash: this.playlist.hash },
});
Expand Down

0 comments on commit 97db776

Please sign in to comment.