fix: governance 404 page
This commit is contained in:
parent
acf0f2e818
commit
d7eed4262e
8 changed files with 114 additions and 47 deletions
|
@ -12,7 +12,7 @@ import Metrics from '@/components/governance/Metrics'
|
|||
export default {
|
||||
middleware({ store, error }) {
|
||||
if (!store.getters['governance/gov/isEnabledGovernance']) {
|
||||
return error({ statusCode: 404 })
|
||||
return error({ statusCode: 204, pageName: 'governance' })
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -25,14 +25,16 @@ export default {
|
|||
watch: {
|
||||
isInitialized: {
|
||||
handler() {
|
||||
this.fetchProposals({})
|
||||
this.fetchConstants()
|
||||
if (this.isEnabledGovernance) {
|
||||
this.fetchProposals({})
|
||||
this.fetchConstants()
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
isEnabledGovernance(isEnabled) {
|
||||
if (!isEnabled) {
|
||||
this.$router.push('/')
|
||||
this.$nuxt.error({ statusCode: 204, pageName: 'governance' })
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue