Skip to content

Commit 63386c1

Browse files
committed
clean up
1 parent 7a0f66a commit 63386c1

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

packages/ui/src/components/widgets/TokenWidget/widget/TokenWidgetRenderer.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -489,29 +489,23 @@ const TokenWidgetRenderer: FC<TokenWidgetRendererProps> = ({
489489
? linkedWallets?.find((wallet) => wallet.address === recipient)
490490
: undefined) !== undefined
491491

492-
const isValidFromAddress = useMemo(() => {
493-
// When multi-wallet is enabled, validate against the linked wallet's VM type
494-
const vmTypeToValidate =
495-
multiWalletSupportEnabled && linkedWallet?.vmType
496-
? linkedWallet.vmType
497-
: fromChain?.vmType
498-
499-
return isValidAddress(
500-
vmTypeToValidate,
501-
address ?? '',
492+
const isValidFromAddress = useMemo(
493+
() =>
494+
isValidAddress(
495+
fromChain?.vmType,
496+
address ?? '',
497+
fromChain?.id,
498+
linkedWallet?.connector,
499+
connectorKeyOverrides
500+
),
501+
[
502+
fromChain?.vmType,
503+
address,
502504
fromChain?.id,
503505
linkedWallet?.connector,
504506
connectorKeyOverrides
505-
)
506-
}, [
507-
multiWalletSupportEnabled,
508-
linkedWallet?.vmType,
509-
fromChain?.vmType,
510-
address,
511-
fromChain?.id,
512-
linkedWallet?.connector,
513-
connectorKeyOverrides
514-
])
507+
]
508+
)
515509
const fromAddressWithFallback = addressWithFallback(
516510
fromChain?.vmType,
517511
address,

0 commit comments

Comments
 (0)