Skip to content

Commit

Permalink
refactor(get-supply): move function call to the dho-selector (#2335)
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenijesavic authored Jul 15, 2023
1 parent 9d4084a commit a72f930
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components/profiles/wallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default {
computed: {
...mapGetters('accounts', ['account']),
...mapGetters('ballots', ['supply']),
...mapGetters('dao', ['daoSettings']),
isOwner () { return this.username === this.account }
Expand All @@ -45,7 +46,6 @@ export default {
},
methods: {
...mapActions('ballots', ['getSupply']),
...mapActions('payments', ['redeemAddress']),
...mapActions('profiles', ['getTokensAmounts']),
Expand All @@ -63,7 +63,7 @@ export default {
async fetchTokens () {
try {
this.wallet = []
this.supply = parseFloat(await this.getSupply())
if (this.username) {
const tokens = await this.getTokensAmounts(this.username)
this.pegToken = tokens.peg
Expand Down
1 change: 1 addition & 0 deletions src/layouts/DhoSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
this.$store.dispatch('accounts/checkMembership')
this.$store.commit('dao/switchDao', data)
this.$store.dispatch('dao/setTheme')
this.$store.dispatch('ballots/getSupply')
},
skip () { return !this.dhoname || !this.daoRegexp },
variables () { return { regexp: this.daoRegexp } },
Expand Down
10 changes: 1 addition & 9 deletions src/pages/proposals/ProposalHistory.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { mapActions, mapGetters } from 'vuex'
import { mapGetters } from 'vuex'
import { getProposalChipFilters } from '../../utils/proposal-filter'
import { PROPOSAL_STATE } from '~/const'
Expand Down Expand Up @@ -84,7 +84,6 @@ export default {
},
watch: {
selectedDao () {
this.getSupply()
this.$apollo.queries.archivedProposals.stop()
if (this.archivedProposals) {
this.resetPaginationValues()
Expand Down Expand Up @@ -129,18 +128,11 @@ export default {
window.scrollTo(0, 0)
},
created () {
if (!this.supply) {
this.getSupply()
}
},
activated () {
this.$apollo.queries.archivedProposals.refetch()
},
methods: {
...mapActions('ballots', ['getSupply']),
async onLoad (index, done) {
if (this.$apollo.queries.archivedProposals.loading) {
return
Expand Down
9 changes: 1 addition & 8 deletions src/pages/proposals/ProposalList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { mapActions, mapGetters } from 'vuex'
import { mapGetters } from 'vuex'
import ipfsy from '~/utils/ipfsy'
import { getProposalChipFilters } from '../../utils/proposal-filter'
import gql from 'graphql-tag'
Expand Down Expand Up @@ -595,7 +595,6 @@ export default {
},
watch: {
selectedDao () {
this.getSupply()
this.$apollo.queries.dao.stop()
if (this.dao) {
this.resetPaginationValues()
Expand Down Expand Up @@ -633,11 +632,6 @@ export default {
}
},
created () {
if (!this.supply) {
this.getSupply()
}
},
activated () {
this.$apollo.queries.stagedProposals.refetch()
},
Expand All @@ -647,7 +641,6 @@ export default {
}
},
methods: {
...mapActions('ballots', ['getSupply']),
hideProposalBanner () {
localStorage.setItem('showProposalBanner', false)
Expand Down

0 comments on commit a72f930

Please sign in to comment.