From a45c9a9448993253d93becb01e5596a82c77794e Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 3 Apr 2024 22:53:07 +0700 Subject: [PATCH] fix remove shouldContainPendingDeleteOption --- src/libs/OptionsListUtils.ts | 4 ++-- .../workspace/categories/WorkspaceCategoriesSettingsPage.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 56e2492a99b1..2f86819d91c6 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -826,8 +826,8 @@ function getSearchValueForPhoneOrEmail(searchTerm: string) { /** * Verifies that there is at least one enabled option */ -function hasEnabledOptions(options: PolicyCategories | PolicyTag[], shouldContainPendingDeleteOption = true): boolean { - return Object.values(options).some((option) => option.enabled && (shouldContainPendingDeleteOption || option.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)); +function hasEnabledOptions(options: PolicyCategories | PolicyTag[]): boolean { + return Object.values(options).some((option) => option.enabled && option.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE); } /** diff --git a/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx index bf17abd463b1..260b6b94d4dc 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx @@ -36,7 +36,7 @@ function WorkspaceCategoriesSettingsPage({route, policyCategories}: WorkspaceCat setWorkspaceRequiresCategory(route.params.policyID, value); }; - const hasEnabledOptions = OptionsListUtils.hasEnabledOptions(policyCategories ?? {}, false); + const hasEnabledOptions = OptionsListUtils.hasEnabledOptions(policyCategories ?? {}); return (