Skip to content

Commit

Permalink
fix: reload data
Browse files Browse the repository at this point in the history
	If the route is not the same or the url parameter changed,
	the data of the entire page must be requested
  • Loading branch information
krlz16 committed Jun 7, 2024
1 parent 91cf097 commit 67a6394
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/DataPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export default {
return {
storedTitle: '',
storedRouteName: null,
storedUrlParam: null,
PAGE_COLORS
}
},
Expand Down Expand Up @@ -301,10 +302,13 @@ export default {
const key = this.reqKey
if (!module || !action) return
const routeName = this.$route.name
const { address, number, hash } = this.$route.params
const urlParam = address || number || hash
// If the parameters are the same when the router changes, we do not request the address information.
if (this.storedRouteName !== routeName) {
if (this.storedRouteName !== routeName || this.storedUrlParam !== urlParam) {
// use Date for a random info
this.storedRouteName = routeName || new Date()
this.storedUrlParam = urlParam
return this.fetchRouteData({ action, params, module, key })
}
},
Expand Down

0 comments on commit 67a6394

Please sign in to comment.