Skip to content

Commit

Permalink
Merge pull request #44866 from Krishna2323/krishna2323/issue/44826
Browse files Browse the repository at this point in the history
fix: Categories - The subtitle under 'Members must categorize all expenses' contains 'undefined'.
  • Loading branch information
tgolen authored Jul 4, 2024
2 parents ddee1b2 + 5158ef1 commit 4933a33
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSet
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`);
const currentConnectionName = PolicyUtils.getCurrentConnectionName(policy);

const toggleSubtitle = `${translate('workspace.categories.needCategoryForExportToIntegration')} ${currentConnectionName}.`;
const toggleSubtitle = isConnectedToAccounting && currentConnectionName ? `${translate('workspace.categories.needCategoryForExportToIntegration')} ${currentConnectionName}.` : undefined;

const updateWorkspaceRequiresCategory = (value: boolean) => {
setWorkspaceRequiresCategory(policyID, value);
Expand All @@ -49,7 +49,7 @@ function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSet
<ToggleSettingOptionRow
title={translate('workspace.categories.requiresCategory')}
subtitle={toggleSubtitle}
switchAccessibilityLabel={toggleSubtitle}
switchAccessibilityLabel={translate('workspace.categories.requiresCategory')}
isActive={policy?.requiresCategory ?? false}
onToggle={updateWorkspaceRequiresCategory}
pendingAction={policy?.pendingFields?.requiresCategory}
Expand Down

0 comments on commit 4933a33

Please sign in to comment.