Refactor TaskWorkspace to use getFeatureValue for feature flag retrieval, improving clarity and consistency in skip button functionality.
Some checks failed
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit
Some checks failed
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import { useFeature } from '@brojs/cli'
|
||||
import { getFeatureValue } from '@brojs/cli'
|
||||
|
||||
import type { ChallengeTask } from '../../__data__/types'
|
||||
import { useChallenge } from '../../context/ChallengeContext'
|
||||
@@ -29,7 +29,7 @@ export const TaskWorkspace = ({ task, onTaskComplete, onTaskSkip }: TaskWorkspac
|
||||
})
|
||||
|
||||
// Проверяем, включена ли кнопка пропуска через feature flag
|
||||
const skipEnabled = useFeature('challenge', 'task.skip.enabled', 'false') === 'true'
|
||||
const skipEnabled = getFeatureValue('challenge', 'task.skip.enabled', 'false').value === 'true'
|
||||
|
||||
// Сохраняем последний результат, чтобы блок не исчезал
|
||||
const [lastResult, setLastResult] = useState<typeof finalSubmission>(null)
|
||||
|
||||
Reference in New Issue
Block a user