Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue-939]: Fix bug related to SendFund #948

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading