Skip to content

Commit

Permalink
Merge pull request Expensify#49989 from software-mansion-labs/kicu/49…
Browse files Browse the repository at this point in the history
…980-fix-transition

Fix translations flickering on Search delete modal
  • Loading branch information
luacmartins authored Oct 1, 2024
2 parents c7ee85b + 1ddbba2 commit 2c07b39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useMemo, useState} from 'react';
import type {StyleProp, TextStyle} from 'react-native';
import {View} from 'react-native';
import {InteractionManager, View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import Button from '@components/Button';
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
Expand Down Expand Up @@ -150,9 +150,14 @@ function SearchPageHeader({queryJSON, hash}: SearchPageHeaderProps) {
return;
}

clearSelectedTransactions();
setIsDeleteExpensesConfirmModalVisible(false);
SearchActions.deleteMoneyRequestOnSearch(hash, selectedTransactionsKeys);

// Translations copy for delete modal depends on amount of selected items,
// We need to wait for modal to fully disappear before clearing them to avoid translation flicker between singular vs plural
InteractionManager.runAfterInteractions(() => {
clearSelectedTransactions();
});
};

const headerButtonsOptions = useMemo(() => {
Expand Down

0 comments on commit 2c07b39

Please sign in to comment.