From a19beb1867790895ac4cced1b19c14d30d934d39 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 2 Apr 2024 23:49:08 +0700 Subject: [PATCH] fix use hasEnabledOptions insteads of getEnabledCategoriesCount --- .../workspace/categories/WorkspaceCategoriesSettingsPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx index 57c69be49809..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 policyCategoriesCount = OptionsListUtils.getEnabledCategoriesCount(policyCategories ?? {}); + const hasEnabledOptions = OptionsListUtils.hasEnabledOptions(policyCategories ?? {}); return ( @@ -64,7 +64,7 @@ function WorkspaceCategoriesSettingsPage({route, policyCategories}: WorkspaceCat isOn={policy?.requiresCategory ?? false} accessibilityLabel={translate('workspace.categories.requiresCategory')} onToggle={updateWorkspaceRequiresCategory} - disabled={!policy?.areCategoriesEnabled || policyCategoriesCount === 0} + disabled={!policy?.areCategoriesEnabled || !hasEnabledOptions} />