fix gov proposal loading issue

This commit is contained in:
liangping 2023-05-14 14:24:07 +08:00
parent f48c9b8a79
commit ef747b2e22
2 changed files with 11 additions and 5 deletions

View File

@ -72,7 +72,6 @@ export const useIndexModule = defineStore('module-index', {
total_volumes: [] as number[],
},
communityPool: [] as { amount: string; denom: string }[],
proposals: {} as PaginatedProposals,
tally: {} as Record<string, Tally>,
};
},
@ -130,6 +129,11 @@ export const useIndexModule = defineStore('module-index', {
return staking.pool;
},
proposals() {
const gov = useGovStore()
return gov.proposals['2']
},
stats() {
const base = useBaseStore();
const bank = useBankStore();
@ -205,10 +209,10 @@ export const useIndexModule = defineStore('module-index', {
denom: t.denom,
}));
});
const gov = useGovStore();
gov.fetchProposals('2').then((x) => {
this.proposals = x;
});
// const gov = useGovStore();
// gov.fetchProposals('2').then((x) => {
// this.proposals = x;
// });
},
tickerColor(color: string) {
return colorMap(color);

View File

@ -23,7 +23,9 @@ export const useGovStore = defineStore('govStore', {
},
actions: {
initial() {
this.$reset()
this.fetchParams();
this.fetchProposals("2");
},
async fetchProposals(status: string, pagination?: PageRequest) {
if (!this.loading[status]) {