Skip to content

Commit

Permalink
Merge pull request #52022 from callstack-internal/workspace-feed-fix-…
Browse files Browse the repository at this point in the history
…bank-clean-up-in-others

[NO QA]: Workspace feed fix bank clean up in others
  • Loading branch information
mountiny authored Nov 6, 2024
2 parents c0dcabc + ac155df commit e2987bd
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 @@ -91,6 +91,9 @@ function CardTypeStep() {
const {canUseDirectFeeds} = usePermissions();
const [isError, setIsError] = useState(false);
const data = getAvailableCompanyCardTypes({isAmexAvailable: !canUseDirectFeeds, 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 @@ -100,6 +103,7 @@ function CardTypeStep() {
step: CONST.COMPANY_CARDS.STEP.CARD_INSTRUCTIONS,
data: {
feedType: typeSelected,
bankName: isNewCardTypeSelected && (!canUseDirectFeeds || isOtherBankSelected) ? '' : bankName,
},
isEditing: false,
});
Expand Down

0 comments on commit e2987bd

Please sign in to comment.