mirror of https://github.com/harness/drone.git
fix: default implementation useFeatureFlags (#1068)
parent
98fdb3da03
commit
64114fd250
|
@ -17,13 +17,14 @@
|
|||
import React, { useState, useContext, useEffect, useMemo } from 'react'
|
||||
import { matchPath } from 'react-router-dom'
|
||||
import { useAtom } from 'jotai'
|
||||
import { noop } from 'lodash-es'
|
||||
import { noop, merge } from 'lodash-es'
|
||||
import { useGet } from 'restful-react'
|
||||
import type { AppProps } from 'AppProps'
|
||||
import { routes } from 'RouteDefinitions'
|
||||
import type { TypesUser } from 'services/code'
|
||||
import { currentUserAtom } from 'atoms/currentUser'
|
||||
import { newCacheStrategy } from 'utils/CacheStrategy'
|
||||
import { useFeatureFlags } from 'hooks/useFeatureFlag'
|
||||
|
||||
interface AppContextProps extends AppProps {
|
||||
setAppContext: (value: Partial<AppProps>) => void
|
||||
|
@ -62,7 +63,7 @@ export const AppContextProvider: React.FC<{ value: AppProps }> = React.memo(func
|
|||
lazy: true
|
||||
})
|
||||
const [currentUser, setCurrentUser] = useAtom(currentUserAtom)
|
||||
const [appStates, setAppStates] = useState<AppProps>(initialValue)
|
||||
const [appStates, setAppStates] = useState<AppProps>(merge({ hooks: { useFeatureFlags } }, initialValue))
|
||||
|
||||
useEffect(() => {
|
||||
// Fetch current user when conditions to fetch it matched and
|
||||
|
|
|
@ -38,7 +38,7 @@ ReactDOM.render(
|
|||
useExecutionDataHook: noop,
|
||||
useLogsContent: noop,
|
||||
useLogsStreaming: noop,
|
||||
useFeatureFlags: useFeatureFlags
|
||||
useFeatureFlags
|
||||
}}
|
||||
currentUser={defaultCurrentUser}
|
||||
currentUserProfileURL=""
|
||||
|
|
Loading…
Reference in New Issue