fix: feature flag does not cached

This commit is contained in:
Louis 2023-11-24 15:33:34 +07:00
parent 5ae319db33
commit 26587e8ab0
2 changed files with 3 additions and 7 deletions

View File

@ -22,12 +22,9 @@ export default function FeatureToggleWrapper({
const [experimentalEnabed, setExperimentalEnabled] = useState<boolean>(false)
useEffect(() => {
// Global experimental feature is disabled
let globalFeatureEnabled = false
if (localStorage.getItem(EXPERIMENTAL_FEATURE_ENABLED) !== 'true') {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
globalFeatureEnabled = true
}
setExperimentalEnabled(
localStorage.getItem(EXPERIMENTAL_FEATURE_ENABLED) === 'true'
)
}, [])
const setExperimentalFeature = (on: boolean) => {

View File

@ -5,7 +5,6 @@ import { ChatCompletionRole, MessageStatus, ThreadMessage } from '@janhq/core'
import hljs from 'highlight.js'
import { MoreVertical } from 'lucide-react'
import { Marked } from 'marked'
import { markedHighlight } from 'marked-highlight'