Skip to content

Commit

Permalink
Bugfix for icmaa-looks product-load on router interaction (#547)
Browse files Browse the repository at this point in the history
* Products won't load when switching between looks
  • Loading branch information
cewald authored Feb 5, 2021
1 parent dfb00ea commit 300a5ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/modules/icmaa-looks/components/Look.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export default {
return this.getProducts(this.look.products)
}
},
watch: {
look () {
this.loadProducts()
}
},
methods: {
async loadProducts (skus) {
return this.$store.dispatch('icmaaLooks/getLookProducts', this.look.products || [])
Expand Down
4 changes: 2 additions & 2 deletions src/modules/icmaa-looks/pages/Looks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export default {
return this.looks[0]
}
},
async asyncData ({ store, route, context }) {
async asyncData ({ store, route }) {
const identifier = route.params.identifier
if (identifier && !store.getters['icmaaLooks/getByIdentifier']('identifier')) {
if (identifier && !store.getters['icmaaLooks/getByIdentifier'](identifier)) {
await store.dispatch('icmaaLooks/single', { value: identifier })
}
Expand Down

0 comments on commit 300a5ec

Please sign in to comment.