Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/pages/inbox/DeleteTransactionNavigateBackHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import ONYXKEYS from '@src/ONYXKEYS';
/**
* Component that does not render anything but isolates the NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL
* subscription from ReportScreen. Clears the URL after interactions complete
* when the report is focused.
* when the report is no longer focused.
*/
function DeleteTransactionNavigateBackHandler() {
const isFocused = useIsFocused();
const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL);

useEffect(() => {
if (!isFocused || !deleteTransactionNavigateBackUrl) {
if (isFocused || !deleteTransactionNavigateBackUrl) {
return;
}
if (doesDeleteNavigateBackUrlIncludeDuplicatesReview(deleteTransactionNavigateBackUrl)) {
return;
}
// Clear the URL after all interactions are processed to ensure all updates are completed before hiding the skeleton
// Clear the URL only after we navigate away to avoid a brief Not Found flash.
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(() => {
Expand Down
Loading