diff --git a/frontend/task/TaskRestartButton.tsx b/frontend/task/TaskRestartButton.tsx index b888deb7..c37f0c19 100644 --- a/frontend/task/TaskRestartButton.tsx +++ b/frontend/task/TaskRestartButton.tsx @@ -5,14 +5,16 @@ import {useDispatch} from 'react-redux'; import {bufferResetToDefaultSourceCode} from '../buffers/buffer_actions'; import {useAppSelector} from '../hooks'; import {quickAlgoLibraries} from './libs/quick_algo_libraries_model'; +import {selectActiveBufferPlatform} from '../buffers/buffer_selectors'; export function TaskRestartButton() { const dispatch = useDispatch(); const activeBufferName = useAppSelector(state => state.buffers.activeBufferName); + const activeBufferPlatform = useAppSelector(selectActiveBufferPlatform); const environment = useAppSelector(state => state.environment); const context = quickAlgoLibraries.getContext(null, environment); - if (!context?.infos?.startingExample) { + if (!context?.infos?.startingExample || !(activeBufferPlatform in context?.infos?.startingExample)) { return null; }