diff --git a/services/web/frontend/js/features/source-editor/components/cm6-switch-away-survey.tsx b/services/web/frontend/js/features/source-editor/components/cm6-switch-away-survey.tsx index ebc3dc0771..a7b72d67cc 100644 --- a/services/web/frontend/js/features/source-editor/components/cm6-switch-away-survey.tsx +++ b/services/web/frontend/js/features/source-editor/components/cm6-switch-away-survey.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { Button } from 'react-bootstrap' import customLocalStorage from '../../../infrastructure/local-storage' import useScopeValue from '../../../shared/hooks/use-scope-value' +import getMeta from '../../../utils/meta' type CM6SwitchAwaySurveyState = 'disabled' | 'enabled' | 'shown' @@ -12,6 +13,11 @@ export default function CM6SwitchAwaySurvey() { const initialRichTextPreference = useRef(richText) useEffect(() => { + // if cm6 is not available, don't show the survey + if (!getMeta('ol-showNewSourceEditorOption')) { + return + } + // If the user has previously seen the survey, then don't show it again const hasSeenCM6SwitchAwaySurvey = customLocalStorage.getItem( 'editor.has_seen_cm6_switch_away_survey'