Skip to content

Commit

Permalink
remove dupe logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jun 13, 2024
1 parent c426487 commit 7ad6165
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,6 @@ function WorkspaceMemberDetailsPage({personalDetails, policy, route}: WorkspaceM
[member?.role, translate],
);

useEffect(() => {
if (!policy?.errorFields?.changeOwner && policy?.isChangeOwnerSuccessful) {
return;
}

const changeOwnerErrors = Object.keys(policy?.errorFields?.changeOwner ?? {});

if (changeOwnerErrors && changeOwnerErrors.length > 0) {
Navigation.navigate(ROUTES.WORKSPACE_OWNER_CHANGE_CHECK.getRoute(policyID, accountID, changeOwnerErrors[0] as ValueOf<typeof CONST.POLICY.OWNERSHIP_ERRORS>));
}
}, [accountID, policy?.errorFields?.changeOwner, policy?.isChangeOwnerSuccessful, policyID]);

useEffect(() => {
if (!prevMember || prevMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || member?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function WorkspaceOwnerChangeWrapperPage({route, policy}: WorkspaceOwnerChangeWr

const changeOwnerErrors = Object.keys(policy?.errorFields?.changeOwner ?? {});

if (changeOwnerErrors && changeOwnerErrors.length > 0 && changeOwnerErrors[0] !== CONST.POLICY.OWNERSHIP_ERRORS.NO_BILLING_CARD) {
if (changeOwnerErrors && changeOwnerErrors.length > 0) {
Navigation.navigate(ROUTES.WORKSPACE_OWNER_CHANGE_CHECK.getRoute(policyID, accountID, changeOwnerErrors[0] as ValueOf<typeof CONST.POLICY.OWNERSHIP_ERRORS>));
}
}, [accountID, policy, policy?.errorFields?.changeOwner, policyID]);
Expand Down

0 comments on commit 7ad6165

Please sign in to comment.