Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Search - App returns to Inbox after deleting expense from report … #121

Merged
merged 1 commit into from
Oct 29, 2024
Merged
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
7 changes: 4 additions & 3 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import {isEmailPublicDomain} from './LoginUtils';
import ModifiedExpenseMessage from './ModifiedExpenseMessage';
import linkingConfig from './Navigation/linkingConfig';
import Navigation, {navigationRef} from './Navigation/Navigation';
import {isFullScreenName} from './NavigationUtils';
import * as NumberUtils from './NumberUtils';
import Parser from './Parser';
import Permissions from './Permissions';
Expand Down Expand Up @@ -4115,10 +4116,10 @@ function navigateBackAfterDeleteTransaction(backRoute: Route | undefined, isFrom
if (!backRoute) {
return;
}
// @TODO: Verify if this method works correctly

const rootState = navigationRef.current?.getRootState();
const topmostRoute = rootState?.routes.at(-1);
if (topmostRoute?.name === SCREENS.SEARCH.CENTRAL_PANE) {
const lastFullScreenRoute = rootState?.routes.findLast((route) => isFullScreenName(route.name));
if (lastFullScreenRoute?.name === SCREENS.SEARCH.CENTRAL_PANE) {
Navigation.dismissModal();
return;
}
Expand Down
Loading