Skip to content

Commit

Permalink
fix: refactored feature flag variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianwzq committed Nov 30, 2023
1 parent 531a7e4 commit 19e4809
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useLocation } from 'react-router-dom'
import { Box, Container, Divider, Stack } from '@chakra-ui/react'
import { useFeatureValue } from '@growthbook/growthbook-react'

import { featureFlags } from '~shared/constants'
import { FormResponseMode } from '~shared/types/form'

import { ACTIVE_ADMINFORM_RESULTS_ROUTE_REGEX } from '~constants/routes'
Expand All @@ -22,7 +23,10 @@ export const ChartsPage = (): JSX.Element => {
const { data: form, isLoading } = useAdminForm()
const { totalResponsesCount, secretKey } = useStorageResponsesContext()
const { pathname } = useLocation()
const chartsMaxResponseCount = useFeatureValue('chartsMaxResponseCount', 100) // limit number of responses to 100 as fallback
const chartsMaxResponseCount = useFeatureValue(
featureFlags.chartsMaxResponseCount,
100,
) // limit number of responses to 100 as fallback
const toast = useToast({ status: 'danger' })

if (isLoading) return <ResponsesPageSkeleton />
Expand Down
1 change: 1 addition & 0 deletions shared/constants/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const featureFlags = {
encryptionBoundaryShiftVirusScanner:
'encryption-boundary-shift-virus-scanner' as const,
myinfoSgid: 'myinfo-sgid' as const,
chartsMaxResponseCount: 'charts-max-response-count' as const,
}

0 comments on commit 19e4809

Please sign in to comment.