Skip to content

Commit

Permalink
fix: hide required wallet info message when wallet is present (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
melianessa authored Jan 31, 2025
1 parent 6727adc commit 88b5e18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/widget/src/components/Messages/useMessageQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface QueuedMessage {
}

export const useMessageQueue = (route?: Route) => {
const { requiredToAddress, accountNotDeployedAtDestination } =
const { requiredToAddress, accountNotDeployedAtDestination, toAddress } =
useToAddressRequirements()
const { insufficientFromToken } = useFromTokenSufficiency(route)
const { insufficientGas } = useGasSufficiency(route)
Expand Down Expand Up @@ -41,7 +41,7 @@ export const useMessageQueue = (route?: Route) => {
})
}

if (requiredToAddress) {
if (requiredToAddress && !toAddress) {
queue.push({
id: 'TO_ADDRESS_REQUIRED',
priority: 4,
Expand All @@ -50,10 +50,11 @@ export const useMessageQueue = (route?: Route) => {

return queue.sort((a, b) => a.priority - b.priority)
}, [
accountNotDeployedAtDestination,
insufficientFromToken,
insufficientGas,
accountNotDeployedAtDestination,
requiredToAddress,
toAddress,
])

return {
Expand Down
1 change: 1 addition & 0 deletions packages/widget/src/hooks/useToAddressRequirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ export const useToAddressRequirements = () => {
requiredToAddress,
requiredToChainType: toChain?.chainType,
accountNotDeployedAtDestination,
toAddress,
}
}

0 comments on commit 88b5e18

Please sign in to comment.