diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index d1326ee8f7338..0ff65daa7e5bd 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -606,12 +606,7 @@ function leaveWorkspace(policyID: string) { { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, - value: { - pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, - employeeList: { - [sessionEmail]: null, - }, - }, + value: null, }, ]; const failureData: OnyxUpdate[] = [ diff --git a/src/pages/workspace/WorkspaceJoinUserPage.tsx b/src/pages/workspace/WorkspaceJoinUserPage.tsx index e14fda8753c9b..d73dab51c4feb 100644 --- a/src/pages/workspace/WorkspaceJoinUserPage.tsx +++ b/src/pages/workspace/WorkspaceJoinUserPage.tsx @@ -6,6 +6,7 @@ import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import ScreenWrapper from '@components/ScreenWrapper'; import useThemeStyles from '@hooks/useThemeStyles'; import navigateAfterJoinRequest from '@libs/navigateAfterJoinRequest'; +import * as PolicyUtils from '@libs/PolicyUtils'; import Navigation from '@navigation/Navigation'; import type {AuthScreensParamList} from '@navigation/types'; import * as MemberAction from '@userActions/Policy/Member'; @@ -42,7 +43,7 @@ function WorkspaceJoinUserPage({route, policy}: WorkspaceJoinUserPageProps) { if (isUnmounted.current || isJoinLinkUsed) { return; } - if (!isEmptyObject(policy) && !policy?.isJoinRequestPending) { + if (!isEmptyObject(policy) && !policy?.isJoinRequestPending && !PolicyUtils.isPendingDeletePolicy(policy)) { Navigation.isNavigationReady().then(() => { Navigation.goBack(undefined, false, true); Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID ?? '-1'));