Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
fix old proposals (#1954)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Nov 27, 2023
1 parent 794b146 commit 9bdf934
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/dao/[symbol]/proposal/[pk]/ProposalWarnings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const useProposalSafetyCheck = (proposal: Proposal) => {
[governance]
)
const walletsPassedToInstructions = transactions?.flatMap((tx) =>
tx.account.instructions.flatMap((ins) =>
tx.account.instructions?.flatMap((ins) =>
ins.accounts.map((acc) => acc.pubkey)
)
)
Expand All @@ -158,7 +158,9 @@ const useProposalSafetyCheck = (proposal: Proposal) => {
treasuryAddress.result &&
!!transactions?.length &&
!walletsPassedToInstructions?.find(
(x) => governance?.pubkey.equals(x) || treasuryAddress.result?.equals(x)
(x) =>
x &&
(governance?.pubkey?.equals(x) || treasuryAddress.result?.equals(x))
)

const proposalWarnings: (
Expand Down

1 comment on commit 9bdf934

@vercel
Copy link

@vercel vercel bot commented on 9bdf934 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.