make proposals indexation correct inside hooks
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
a176a16aaf
commit
83dc5ea8e9
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ghost-dao-interface",
|
||||
"private": true,
|
||||
"version": "0.5.23",
|
||||
"version": "0.5.24",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -335,7 +335,7 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
const { data: proposalDeadlines } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const proposalId = searchedIndexes
|
||||
? searchedIndexes?.at(0)
|
||||
? searchedIndexes?.at(index)
|
||||
: proposalsDetailsAt?.at(index)?.result?.at(0);
|
||||
|
||||
return {
|
||||
@ -352,7 +352,7 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
const { data: proposalVotes } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const proposalId = searchedIndexes
|
||||
? searchedIndexes?.at(0)
|
||||
? searchedIndexes?.at(index)
|
||||
: proposalsDetailsAt?.at(index)?.result?.at(0);
|
||||
|
||||
return {
|
||||
@ -369,7 +369,7 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
const { data: proposalStates } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const proposalId = searchedIndexes
|
||||
? searchedIndexes?.at(0)
|
||||
? searchedIndexes?.at(index)
|
||||
: proposalsDetailsAt?.at(index)?.result?.at(0);
|
||||
|
||||
return {
|
||||
@ -386,7 +386,7 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
const { data: proposalSnapshots } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const proposalId = searchedIndexes
|
||||
? searchedIndexes?.at(0)
|
||||
? searchedIndexes?.at(index)
|
||||
: proposalsDetailsAt?.at(index)?.result?.at(0);
|
||||
|
||||
return {
|
||||
@ -401,8 +401,8 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
});
|
||||
|
||||
const { data: proposalQuorums } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const timepoint = proposalSnapshots?.at(index)?.result;
|
||||
contracts: proposalSnapshots?.map((proposal, index) => {
|
||||
const timepoint = proposal?.result;
|
||||
return {
|
||||
abi: GovernorAbi,
|
||||
address: GHOST_GOVERNANCE_ADDRESSES[chainId],
|
||||
@ -415,8 +415,8 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
});
|
||||
|
||||
const { data: pastTotalSupplies } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const timepoint = proposalSnapshots?.at(index)?.result;
|
||||
contracts: proposalSnapshots?.map((proposal, index) => {
|
||||
const timepoint = proposal?.result;
|
||||
return {
|
||||
abi: ghstAbi,
|
||||
address: ghstAddress,
|
||||
@ -431,7 +431,7 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
const { data: proposalProposer } = useReadContracts({
|
||||
contracts: indexes?.map(index => {
|
||||
const proposalId = searchedIndexes
|
||||
? searchedIndexes?.at(0)
|
||||
? searchedIndexes?.at(index)
|
||||
: proposalsDetailsAt?.at(index)?.result?.at(0);
|
||||
|
||||
return {
|
||||
@ -448,7 +448,7 @@ export const useProposals = (chainId, depth, searchedIndexes) => {
|
||||
const hashes = indexes?.map(index => {
|
||||
let result = { short: index + 1, full: undefined };
|
||||
const proposalId = searchedIndexes
|
||||
? searchedIndexes?.at(0)
|
||||
? searchedIndexes?.at(index)
|
||||
: proposalsDetailsAt?.at(index)?.result?.at(0);
|
||||
|
||||
if (proposalId) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user