Skip to content

Commit

Permalink
Merge pull request #40395 from bernhardoj/fix/39503-transfer-owner-pa…
Browse files Browse the repository at this point in the history
…ge-infinite-back-loop

Fix back navigation loop after refreshing page on transfer owner success
  • Loading branch information
jasperhuangg authored Apr 18, 2024
2 parents e662e00 + 657c8c0 commit 2b603e4
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 2b603e4

Please sign in to comment.