Skip to content

Commit

Permalink
pop the current screen before navigating back to member details page
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Apr 18, 2024
1 parent 2491a29 commit 657c8c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pages/workspace/members/WorkspaceOwnerChangeCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function WorkspaceOwnerChangeCheck({personalDetails, policy, accountID, error}:
if (error === CONST.POLICY.OWNERSHIP_ERRORS.HAS_FAILED_SETTLEMENTS || error === CONST.POLICY.OWNERSHIP_ERRORS.FAILED_TO_CLEAR_BALANCE) {
// cannot transfer ownership if there are failed settlements, or we cannot clear the balance
PolicyActions.clearWorkspaceOwnerChangeFlow(policyID);
Navigation.goBack();
Navigation.navigate(ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function WorkspaceOwnerChangeErrorPage({route}: WorkspaceOwnerChangeSuccessPageP

const closePage = useCallback(() => {
PolicyActions.clearWorkspaceOwnerChangeFlow(policyID);
Navigation.goBack();
Navigation.navigate(ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID));
}, [accountID, policyID]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function WorkspaceOwnerChangeSuccessPage({route}: WorkspaceOwnerChangeSuccessPag

const closePage = useCallback(() => {
PolicyActions.clearWorkspaceOwnerChangeFlow(policyID);
Navigation.goBack();
Navigation.navigate(ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID));
}, [accountID, policyID]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function WorkspaceOwnerChangeWrapperPage({route, policy}: WorkspaceOwnerChangeWr
title={translate('workspace.changeOwner.changeOwnerPageTitle')}
onBackButtonPress={() => {
PolicyActions.clearWorkspaceOwnerChangeFlow(policyID);
Navigation.goBack();
Navigation.navigate(ROUTES.WORKSPACE_MEMBER_DETAILS.getRoute(policyID, accountID));
}}
/>
Expand Down

0 comments on commit 657c8c0

Please sign in to comment.