Skip to content

Commit

Permalink
add cross-chain support back to Apps 5
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jan 7, 2025
1 parent e8d7237 commit 953a730
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/stateful/components/apps/AppsRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,18 @@ export const AppsRenderer = ({ mode, ...props }: AppsRendererProps) => {
// This is the chain we will use for the app. For a wallet, the chain switcher
// will set the wallet chain ID atom which affects the whole app context, so
// this shouldn't matter. For a DAO, this can differ from the DAO's chain ID
// if the target address is on a different chain.
// if the other address is on a different chain.
const appChainId = executionType === 'normal' ? contextChainId : otherChainId
const appChain = getChainForChainId(appChainId)

// This is the other address for non-normal execution types (authz and DAO
// admin execute).
const validOtherAddress =
executionType !== 'normal' &&
otherAddress &&
isValidBech32Address(otherAddress, appChain.bech32Prefix)
isValidBech32Address(
otherAddress,
getChainForChainId(otherChainId).bech32Prefix
)
? otherAddress
: undefined

Expand Down Expand Up @@ -165,10 +167,6 @@ export const AppsRenderer = ({ mode, ...props }: AppsRendererProps) => {
throw new Error('Entity not yet loaded.')
}

if (chainId !== appChainId) {
throw new Error('App chain ID mismatch.')
}

// Potentially wrap in authz execute or DAO admin execute based on the
// execution type.
if (executionType === 'authzExec') {
Expand Down

0 comments on commit 953a730

Please sign in to comment.