From ebf0bb3d1e7b76f8d44d58be66562075e40743d1 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:40:58 +0000 Subject: [PATCH] feat: allow scw to change destination chain --- .../src/components/TransferPanel/AdvancedSettings.tsx | 8 ++++++-- .../src/components/common/NetworkSelectionContainer.tsx | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx index f5051aa244..06e88e7740 100644 --- a/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx +++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/AdvancedSettings.tsx @@ -83,7 +83,11 @@ export const AdvancedSettings = () => { isDepositMode } = useNetworksRelationship(networks) const { address } = useAccount() - const { isEOA, isSmartContractWallet } = useAccountType() + const { + isEOA, + isSmartContractWallet, + isLoading: isLoadingAccountType + } = useAccountType() const [inputLocked, setInputLocked] = useState(true) const [warning, setWarning] = useState(null) @@ -165,7 +169,7 @@ export const AdvancedSettings = () => { }) }, [debouncedDestinationAddress, setQueryParams]) - if (!isEOA && !isSmartContractWallet) { + if (!isEOA && !isSmartContractWallet && !isLoadingAccountType) { return null } diff --git a/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx b/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx index dc328d6034..8f277a7961 100644 --- a/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx +++ b/packages/arb-token-bridge-ui/src/components/common/NetworkSelectionContainer.tsx @@ -122,7 +122,10 @@ export function NetworkButton({ const hasOneOrLessChain = chains.length <= 1 - const disabled = hasOneOrLessChain || isSmartContractWallet || isLoading + const disabled = + hasOneOrLessChain || + (isSmartContractWallet && type === 'source') || + isLoading const buttonStyle = { backgroundColor: getBridgeUiConfigForChain(selectedChainId).color