Skip to content

Commit 959db43

Browse files
authored
Merge pull request Expensify#67136 from thelullabyy/fix/66841-expensify-card-not-found
2 parents 9223102 + 6dcbc2d commit 959db43

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/libs/actions/Card.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ function clearIssueNewCardFlow(policyID: string | undefined) {
383383
});
384384
}
385385

386+
function clearIssueNewCardFormData() {
387+
Onyx.set(ONYXKEYS.FORMS.ISSUE_NEW_EXPENSIFY_CARD_FORM, {});
388+
}
389+
386390
function clearIssueNewCardError(policyID: string | undefined) {
387391
Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null});
388392
}
@@ -971,5 +975,6 @@ export {
971975
deactivateCard,
972976
getCardDefaultName,
973977
queueExpensifyCardForBilling,
978+
clearIssueNewCardFormData,
974979
};
975980
export type {ReplacementReason};

src/pages/workspace/expensifyCard/WorkspaceExpensifyCardListPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
2828
import useSearchResults from '@hooks/useSearchResults';
2929
import useThemeStyles from '@hooks/useThemeStyles';
3030
import useWindowDimensions from '@hooks/useWindowDimensions';
31-
import {setIssueNewCardStepAndData} from '@libs/actions/Card';
31+
import {clearIssueNewCardFormData, setIssueNewCardStepAndData} from '@libs/actions/Card';
3232
import {clearDeletePaymentMethodError} from '@libs/actions/PaymentMethods';
3333
import {filterCardsByPersonalDetails, getCardsByCardholderName, sortCardsByCardholderName} from '@libs/CardUtils';
3434
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
@@ -94,6 +94,7 @@ function WorkspaceExpensifyCardListPage({route, cardsList, fundID}: WorkspaceExp
9494
const [inputValue, setInputValue, filteredSortedCards] = useSearchResults(allCards, filterCard, sortCards);
9595

9696
const handleIssueCardPress = () => {
97+
clearIssueNewCardFormData();
9798
if (isAccountLocked) {
9899
showLockedAccountModal();
99100
return;

0 commit comments

Comments
 (0)