Skip to content

Commit

Permalink
clear selected transaction when modal hides
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Aug 1, 2024
1 parent 3864ff0 commit f4fcc47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) {
}, [isSmallScreenWidth, selectedTransactions, selectionMode?.isEnabled]);

const handleOnCancelConfirmModal = () => {
setSelectedTransactionsToDelete([]);
setDeleteExpensesConfirmModalVisible(false);
};

Expand Down Expand Up @@ -386,6 +385,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) {
isVisible={deleteExpensesConfirmModalVisible}
onConfirm={handleDeleteExpenses}
onCancel={handleOnCancelConfirmModal}
onModalHide={() => setSelectedTransactionsToDelete([])}
title={translate('iou.deleteExpense', {count: selectedTransactionsToDelete.length})}
prompt={translate('iou.deleteConfirmation', {count: selectedTransactionsToDelete.length})}
confirmText={translate('common.delete')}
Expand Down

0 comments on commit f4fcc47

Please sign in to comment.