Skip to content

Commit

Permalink
Merge pull request #948 from Koniverse/issue-939
Browse files Browse the repository at this point in the history
[Issue-939]: Fix bug related to SendFund
  • Loading branch information
nguyenduythuc authored Aug 15, 2023
2 parents b5aaf71 + 4157936 commit 2c945d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/components/Modal/common/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface Props {
onSelectItem?: (item: ChainInfo) => void;
renderSelected?: () => JSX.Element;
disabled?: boolean;
acceptDefaultValue?: boolean;
chainSelectorRef: React.MutableRefObject<ModalRef | undefined>;
}

Expand All @@ -19,6 +20,7 @@ export const ChainSelector = ({
onSelectItem,
renderSelected,
disabled,
acceptDefaultValue,
chainSelectorRef,
}: Props) => {
return (
Expand All @@ -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()}
Expand Down
7 changes: 2 additions & 5 deletions src/screens/Transaction/SendFundV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -942,6 +938,7 @@ export const SendFund = ({
<View style={stylesheet.rowItem}>
<ChainSelector
items={viewStep === 1 ? destChainItems : destChainItemsViewStep2}
acceptDefaultValue={viewStep === 2 && destChainItemsViewStep2.length === 1}
selectedValueMap={{ [destChainValue]: true }}
chainSelectorRef={chainSelectorRef}
onSelectItem={_onChangeDestChain}
Expand Down

0 comments on commit 2c945d3

Please sign in to comment.