Skip to content

Commit 4e4515e

Browse files
committed
fix: update dependency
1 parent ddb5da8 commit 4e4515e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/pages/workspace/categories/DynamicCategorySettingsPage.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,20 @@ function DynamicCategorySettingsPage({route, navigation}: DynamicCategorySetting
177177
});
178178
}, [showConfirmModal, translate]);
179179

180+
const policyCategoryName = policyCategory?.name;
181+
180182
const updateWorkspaceCategoryEnabled = useCallback(
181183
(value: boolean) => {
184+
if (!policyCategoryName) {
185+
return;
186+
}
182187
if (shouldPreventDisableOrDelete) {
183188
showCannotDeleteOrDisableLastCategoryModal();
184189
return;
185190
}
186191
setWorkspaceCategoryEnabled({
187192
policyData,
188-
categoriesToUpdate: {[policyCategory.name]: {name: policyCategory.name, enabled: value}},
193+
categoriesToUpdate: {[policyCategoryName]: {name: policyCategoryName, enabled: value}},
189194
isSetupCategoriesTaskParentReportArchived: isSetupCategoryTaskParentReportArchived,
190195
setupCategoryTaskReport,
191196
setupCategoryTaskParentReport,
@@ -204,7 +209,7 @@ function DynamicCategorySettingsPage({route, navigation}: DynamicCategorySetting
204209
showCannotDeleteOrDisableLastCategoryModal,
205210
shouldPreventDisableOrDelete,
206211
policyData,
207-
policyCategory,
212+
policyCategoryName,
208213
isSetupCategoryTaskParentReportArchived,
209214
setupCategoryTaskReport,
210215
setupCategoryTaskParentReport,

0 commit comments

Comments
 (0)