Skip to content

Commit

Permalink
fix map page comparison popup navigation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
solderq35 committed Dec 31, 2023
1 parent 6835595 commit dc19461
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/components/map/map_compareside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ export default {
return buildingIds.map(id => this.$store.getters['map/building'](id))
}
},
buildingBlocks: {
get () {
let buildingBlockArray = []
for (let i in this.buildings) {
// Use spread syntax (...) to create an array of objects, instead of 2d array
buildingBlockArray.push(...this.$store.getters[this.buildings[i].path + '/blocks'])
}
return buildingBlockArray
}
},
mediaArray: {
get () {
if (!this.buildings) return
Expand Down Expand Up @@ -154,6 +164,22 @@ export default {
return 'slantImage'
}
}
},
// Refer to "buildings" and "buildingBlocks" in "computed" section above
// Use buildings > blocks > charts as far as global vuex store getter calls
watch: {
buildings: {
immediate: true,
handler: async function (value) {
for (let buildingBlock of this.buildingBlocks) {
let blockpath = buildingBlock.path
let searchTerm = 'block_'
let chartIndex = blockpath.indexOf(searchTerm)
let blockID = blockpath.slice(chartIndex + searchTerm.length)
this.$store.commit(blockpath + '/chart_' + blockID + '/resetMultTimeStamps')
}
}
}
}
}
</script>
Expand Down

0 comments on commit dc19461

Please sign in to comment.