@@ -28,7 +28,6 @@ import useLocalize from '@hooks/useLocalize';
2828import useMobileSelectionMode from '@hooks/useMobileSelectionMode' ;
2929import useNetwork from '@hooks/useNetwork' ;
3030import useOnyx from '@hooks/useOnyx' ;
31-
3231import usePolicy from '@hooks/usePolicy' ;
3332import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
3433import useSearchBackPress from '@hooks/useSearchBackPress' ;
@@ -190,28 +189,27 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
190189 enabled : true ,
191190 required : policyTagList . required ,
192191 isDisabledCheckbox : isSwitchDisabled ,
193- rightElement :
194- hasDependentTags ? (
195- < ListItemRightCaretWithLabel
196- labelText = { translate ( 'workspace.tags.tagCount' , { count : Object . keys ( policyTagList ?. tags ?? { } ) . length } ) }
197- shouldShowCaret
198- />
199- ) : (
200- < Switch
201- isOn = { isSwitchEnabled }
202- accessibilityLabel = { translate ( 'workspace.tags.requiresTag' ) }
203- onToggle = { ( newValue : boolean ) => {
204- if ( isMakingLastRequiredTagListOptional ( policy , policyTags , [ policyTagList ] ) ) {
205- setIsCannotMakeLastTagOptionalModalVisible ( true ) ;
206- return ;
207- }
208-
209- updateWorkspaceRequiresTag ( newValue , policyTagList . orderWeight ) ;
210- } }
211- disabled = { isSwitchDisabled }
212- showLockIcon = { isMakingLastRequiredTagListOptional ( policy , policyTags , [ policyTagList ] ) }
213- />
214- ) ,
192+ rightElement : hasDependentTags ? (
193+ < ListItemRightCaretWithLabel
194+ labelText = { translate ( 'workspace.tags.tagCount' , { count : Object . keys ( policyTagList ?. tags ?? { } ) . length } ) }
195+ shouldShowCaret
196+ />
197+ ) : (
198+ < Switch
199+ isOn = { isSwitchEnabled }
200+ accessibilityLabel = { translate ( 'workspace.tags.requiresTag' ) }
201+ onToggle = { ( newValue : boolean ) => {
202+ if ( isMakingLastRequiredTagListOptional ( policy , policyTags , [ policyTagList ] ) ) {
203+ setIsCannotMakeLastTagOptionalModalVisible ( true ) ;
204+ return ;
205+ }
206+
207+ updateWorkspaceRequiresTag ( newValue , policyTagList . orderWeight ) ;
208+ } }
209+ disabled = { isSwitchDisabled }
210+ showLockIcon = { isMakingLastRequiredTagListOptional ( policy , policyTags , [ policyTagList ] ) }
211+ />
212+ ) ,
215213 } ;
216214 } ) ;
217215 }
0 commit comments