From 415793669c484036ebb06c0a40c1c39c8430f45f Mon Sep 17 00:00:00 2001 From: dominhquang Date: Mon, 14 Aug 2023 18:37:49 +0700 Subject: [PATCH] [Issue-939]: Fix bug related to SendFund --- src/components/Modal/common/ChainSelector.tsx | 3 +++ src/screens/Transaction/SendFundV2/index.tsx | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Modal/common/ChainSelector.tsx b/src/components/Modal/common/ChainSelector.tsx index 5782628e2..c51bd977a 100644 --- a/src/components/Modal/common/ChainSelector.tsx +++ b/src/components/Modal/common/ChainSelector.tsx @@ -10,6 +10,7 @@ interface Props { onSelectItem?: (item: ChainInfo) => void; renderSelected?: () => JSX.Element; disabled?: boolean; + acceptDefaultValue?: boolean; chainSelectorRef: React.MutableRefObject; } @@ -19,6 +20,7 @@ export const ChainSelector = ({ onSelectItem, renderSelected, disabled, + acceptDefaultValue, chainSelectorRef, }: Props) => { return ( @@ -30,6 +32,7 @@ export const ChainSelector = ({ onSelectItem={onSelectItem} renderSelected={renderSelected} disabled={disabled} + acceptDefaultValue={acceptDefaultValue} placeholder={i18n.placeholder.searchNetwork} ref={chainSelectorRef} onBackButtonPress={() => chainSelectorRef?.current?.onCloseModal()} diff --git a/src/screens/Transaction/SendFundV2/index.tsx b/src/screens/Transaction/SendFundV2/index.tsx index 831e7082f..b1109a990 100644 --- a/src/screens/Transaction/SendFundV2/index.tsx +++ b/src/screens/Transaction/SendFundV2/index.tsx @@ -580,11 +580,7 @@ export const SendFund = ({ if (currentDestChainItems.some(destChainItem => destChainItem.slug === item.originChain)) { setValue('destChain', item.originChain); } else { - if (currentDestChainItems.length === 1) { - setValue('destChain', currentDestChainItems[0].slug); - } else { - setValue('destChain', ''); - } + setValue('destChain', ''); } } else { setValue('destChain', item.originChain); @@ -942,6 +938,7 @@ export const SendFund = ({