mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: device count flag without variant (#8773)
This commit is contained in:
		
							parent
							
								
									2ffff25a4a
								
							
						
					
					
						commit
						6d4e2e991f
					
				| @ -2,20 +2,13 @@ import type { FC } from 'react'; | ||||
| import { IconCell } from 'component/common/Table/cells/IconCell/IconCell'; | ||||
| import WarningIcon from '@mui/icons-material/WarningAmber'; | ||||
| import { Tooltip } from '@mui/material'; | ||||
| import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; | ||||
| import { useVariant } from 'hooks/useVariant'; | ||||
| 
 | ||||
| type UserSessionsCellProps = { | ||||
|     count?: number; | ||||
| }; | ||||
| 
 | ||||
| export const UserSessionsCell: FC<UserSessionsCellProps> = ({ count }) => { | ||||
|     const { uiConfig } = useUiConfig(); | ||||
|     const minimumCountToShow = useVariant<number>( | ||||
|         uiConfig.flags.showUserDeviceCount, | ||||
|     ); | ||||
| 
 | ||||
|     if (!count || count < (minimumCountToShow ? minimumCountToShow : 5)) { | ||||
|     if (!count || count < 5) { | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -93,7 +93,7 @@ export type UiFlags = { | ||||
|     'enterprise-payg'?: boolean; | ||||
|     simplifyProjectOverview?: boolean; | ||||
|     productivityReportEmail?: boolean; | ||||
|     showUserDeviceCount?: Variant; | ||||
|     showUserDeviceCount?: boolean; | ||||
|     flagOverviewRedesign?: boolean; | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -18,6 +18,7 @@ export interface IUser { | ||||
|     addedAt?: string; | ||||
|     accountType?: AccountType; | ||||
|     scimId?: string; | ||||
|     activeSessions?: number; | ||||
| } | ||||
| 
 | ||||
| export interface IPermission { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user