Skip to content

Commit

Permalink
refactor(27674): add isDev and isProd config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Jan 10, 2025
1 parent ce73007 commit 51a938f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions hivemq-edge/src/frontend/src/modules/App/MainApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { routes } from '@/modules/App/routes.tsx'
import { AuthProvider } from '@/modules/Auth/AuthProvider.tsx'
import themeHiveMQ from '@/modules/Theme/themeHiveMQ.ts'
import PrivacyConsentBanner from '@/modules/Trackers/PrivacyConsentBanner.tsx'
import config from '@/config'

const MainApp: FC = () => {
return (
Expand All @@ -22,9 +23,7 @@ const MainApp: FC = () => {
</AuthProvider>
<PrivacyConsentBanner />
</ChakraProvider>
{import.meta.env.MODE === 'development' && (
<ReactQueryDevtools position="bottom" buttonPosition="top-left" initialIsOpen={false} />
)}
{config.isDevMode && <ReactQueryDevtools position="bottom" buttonPosition="top-left" initialIsOpen={false} />}
</QueryClientProvider>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { isRouteErrorResponse, Link as RouterLink, useRouteError } from 'react-r
import { chakra as Chakra, Heading, VStack, Text, Button, Box } from '@chakra-ui/react'
import { useTranslation } from 'react-i18next'
import { FaHome } from 'react-icons/fa'
import config from '@/config'

interface ErrorResponse {
status: number
Expand Down Expand Up @@ -36,7 +37,7 @@ const ErrorPage = () => {
{t('error.backHome')}
</Button>
</VStack>
{import.meta.env.MODE === 'development' && stack && (
{config.isDevMode && stack && (
<Box
overflow="auto"
tabIndex={0}
Expand Down

0 comments on commit 51a938f

Please sign in to comment.