Skip to content

Commit

Permalink
add new variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mkzie2 committed Feb 15, 2025
1 parent ec216bf commit 1b0f7e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ function WorkspaceMemberDetailsPage({personalDetails, policy, route}: WorkspaceM
const removeUser = useCallback(() => {
removeMembers([accountID], policyID);
const previousEmployeesCount = Object.keys(policy?.employeeList ?? {}).length;
if (previousEmployeesCount - 1 === 1 && policy?.preventSelfApproval) {
const remainingEmployeeCount = previousEmployeesCount - 1;
if (remainingEmployeeCount === 1 && policy?.preventSelfApproval) {
// We can't let the "Prevent Self Approvals" enabled if there's only one workspace user
setPolicyPreventSelfApproval(route.params.policyID, false);
}
Expand Down

0 comments on commit 1b0f7e1

Please sign in to comment.