From a980050a7b59a820c099fdb72293b521945816dc Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 14 Sep 2020 00:54:20 -0500 Subject: [PATCH] fix Vuex store data being re-fetched with check, fix .loaded assignment (undefined vs null moment), remove SeasonList popover.show idiocy, Episode.vue comments --- client/src/components/Episode.vue | 5 +++-- client/src/components/SeasonList.vue | 2 +- client/src/store.js | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/client/src/components/Episode.vue b/client/src/components/Episode.vue index 686c61e..4838b62 100644 --- a/client/src/components/Episode.vue +++ b/client/src/components/Episode.vue @@ -71,13 +71,14 @@ export default { Skeleton, }, created() { + // When page loads directly on this Episode initially, fetch data this.fetch(); }, watch: { + // When route changes, fetch data for current Episode route $route() { this.$nextTick(() => { this.fetch(); - // this.$store.dispatch(types.FETCH_EPISODE, {season: this.params.season, episode: this.params.episode}) }) }, }, @@ -102,8 +103,8 @@ export default { computed: { episode() { return this.$store.getters.getEpisode(this.params.season, this.params.episode) - // return this.$store.state.quoteData[this.params.season - 1].episodes[this.params.episode - 1]; }, + // Shorthand - literally useless, why does everything to have such long prefixes in dot notation params() { return this.$route.params }, diff --git a/client/src/components/SeasonList.vue b/client/src/components/SeasonList.vue index bd126dd..1cc2a27 100644 --- a/client/src/components/SeasonList.vue +++ b/client/src/components/SeasonList.vue @@ -20,7 +20,7 @@ :id="`s-${season.season_id}-ep-${episode.episode_id}`"> Episode {{ episode.episode_id }} - "{{ episode.title }}" -