Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Nov 6, 2024
2 parents 68f8c90 + e2987bd commit f6278ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/workspace/companyCards/addNew/CardTypeStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function CardTypeStep() {
const [typeSelected, setTypeSelected] = useState<CardFeedProvider>();
const [isError, setIsError] = useState(false);
const data = getAvailableCompanyCardTypes({translate, typeSelected, styles: styles.mr3});
const {bankName, selectedBank, feedType} = addNewCard?.data ?? {};
const isOtherBankSelected = selectedBank === CONST.COMPANY_CARDS.BANKS.OTHER;
const isNewCardTypeSelected = typeSelected !== feedType;

const submit = () => {
if (!typeSelected) {
Expand All @@ -74,6 +77,7 @@ function CardTypeStep() {
step: CONST.COMPANY_CARDS.STEP.CARD_INSTRUCTIONS,
data: {
feedType: typeSelected,
bankName: isNewCardTypeSelected && isOtherBankSelected ? '' : bankName,
},
isEditing: false,
});
Expand Down

0 comments on commit f6278ef

Please sign in to comment.