Skip to content

Commit 36b1495

Browse files
committed
handle promise error
1 parent c6a78a6 commit 36b1495

File tree

1 file changed

+14
-7
lines changed
  • governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals

1 file changed

+14
-7
lines changed

governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/ProposalRow.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,20 @@ export const ProposalRow = ({
5555

5656
// set proposal time
5757
if (!time) {
58-
connection.getSignaturesForAddress(proposal.publicKey).then((txs) => {
59-
if (isCancelled) return
60-
const firstBlockTime = txs?.[txs.length - 1]?.blockTime
61-
if (firstBlockTime) {
62-
setTime(new Date(firstBlockTime * 1000))
63-
}
64-
})
58+
connection
59+
.getSignaturesForAddress(proposal.publicKey)
60+
.then((txs) => {
61+
if (isCancelled) return
62+
const firstBlockTime = txs?.[txs.length - 1]?.blockTime
63+
if (firstBlockTime) {
64+
setTime(new Date(firstBlockTime * 1000))
65+
}
66+
})
67+
.catch((err) => {
68+
console.error(
69+
`Error fetching proposal time for ${proposal.publicKey.toBase58()}: ${err}`
70+
)
71+
})
6572
}
6673

6774
// calculate instructions summary

0 commit comments

Comments
 (0)