Commit a63f9c73 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

fix bug introduced with bugfix 3af06e50

While the newly introduced watcher solves the issue when reloading
the dashboard on the ShowManager page, now the show info does not
get loaded when the user logs in on the home pages, waits a few seconds
(in which time all the auth info is already loaded) and then goes to
the ShowManager. In that case the watcher will never trigger after
the creation of the ShowManager.

Now the show info gets loaded right away if the auth info for the
steeringUser is already set.
parent d952007a
......@@ -94,31 +94,38 @@ export default {
// Right after this component is set up, we want to fetch all available shows
// and the arrays for the show meta info from the AuRa steering module.
created () {
this.$store.watch(
(state) => state.auth.user.steeringUser,
() => {
this.$store.dispatch('shows/fetchShows', {
callback: () => {
this.$store.dispatch('playlists/fetch', {slug: this.selectedShow.slug})
this.$refs.showSelector.updateInputSelector()
}
})
this.$store.dispatch('shows/fetchMetaArray', {property: 'types', onlyActive: true})
this.$store.dispatch('shows/fetchMetaArray', {property: 'fundingcategories', onlyActive: true})
this.$store.dispatch('shows/fetchMetaArray', {property: 'categories'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'topics'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'musicfocus'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'languages'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'hosts'})
if (this.isSuperuser) { this.$store.dispatch('auth/fetchUsers') }
}
);
if (this.$store.state.auth.user.steeringUser) { this.loadShowInfos() }
else {
this.$store.watch(
(state) => state.auth.user.steeringUser,
() => {
this.loadShowInfos()
}
)
}
},
methods: {
showHasSwitched () {
this.$refs.timeslotsComponent.showHasSwitched()
},
loadShowInfos () {
this.$store.dispatch('shows/fetchShows', {
callback: () => {
this.$store.dispatch('playlists/fetch', {slug: this.selectedShow.slug})
this.$refs.showSelector.updateInputSelector()
}
})
this.$store.dispatch('shows/fetchMetaArray', {property: 'types', onlyActive: true})
this.$store.dispatch('shows/fetchMetaArray', {property: 'fundingcategories', onlyActive: true})
this.$store.dispatch('shows/fetchMetaArray', {property: 'categories'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'topics'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'musicfocus'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'languages'})
this.$store.dispatch('shows/fetchMetaArray', {property: 'hosts'})
if (this.isSuperuser) { this.$store.dispatch('auth/fetchUsers') }
},
}
}
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment