Skip to content

Commit

Permalink
Fixed authz exec bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Sep 15, 2023
1 parent f3a9543 commit 603d93d
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/stateful/actions/core/authorizations/AuthzExec/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
decodePolytoneExecuteMsg,
isDecodedStargateMsg,
isValidContractAddress,
isValidWalletAddress,
makeStargateMessage,
maybeMakePolytoneExecuteMessage,
objectMatchesStructure,
Expand Down Expand Up @@ -97,6 +98,7 @@ const InnerComponentWrapper: ActionComponent<
const { bech32_prefix: bech32Prefix, chain_id: chainId } = useChain()

const isContractAddress = isValidContractAddress(address, bech32Prefix)
const isWalletAddress = isValidWalletAddress(address, bech32Prefix)
// If contract, try to load DAO info.
const daoInfoLoadable = useRecoilValueLoadable(
isContractAddress
Expand All @@ -107,22 +109,22 @@ const InnerComponentWrapper: ActionComponent<
: constSelector(undefined)
)

return isContractAddress && daoInfoLoadable.state !== 'hasError' ? (
daoInfoLoadable.state === 'hasValue' ? (
<SuspenseLoader fallback={<InnerComponentLoading {...props} />}>
<DaoProviders info={daoInfoLoadable.contents!}>
<InnerComponent {...props} />
</DaoProviders>
</SuspenseLoader>
) : (
<InnerComponentLoading {...props} />
)
) : address ? (
return isContractAddress &&
daoInfoLoadable.state === 'hasValue' &&
daoInfoLoadable.contents ? (
<SuspenseLoader fallback={<InnerComponentLoading {...props} />}>
<DaoProviders info={daoInfoLoadable.contents}>
<InnerComponent {...props} />
</DaoProviders>
</SuspenseLoader>
) : (isContractAddress &&
(daoInfoLoadable.state === 'hasError' || !daoInfoLoadable.contents)) ||
isWalletAddress ? (
<WalletActionsProvider address={address}>
<InnerComponent {...props} />
</WalletActionsProvider>
) : (
<InnerComponent {...props} />
<InnerComponentLoading {...props} />
)
}

Expand Down

0 comments on commit 603d93d

Please sign in to comment.