fix: CTA and consent question breaking the survey editor (#5745)

This commit is contained in:
Piyush Gupta
2025-05-13 09:48:34 +05:30
committed by GitHub
parent 13e615a798
commit dde5a55446

View File

@@ -71,16 +71,18 @@ export function LocalizedEditor({
key={`${questionIdx}-${selectedLanguageCode}`}
setFirstRender={setFirstRender}
setText={(v: string) => {
const translatedHtml = {
...value,
[selectedLanguageCode]: v,
};
if (questionIdx === -1) {
// welcome card
updateQuestion({ html: translatedHtml });
return;
if (localSurvey.questions[questionIdx] || questionIdx === -1) {
const translatedHtml = {
...value,
[selectedLanguageCode]: v,
};
if (questionIdx === -1) {
// welcome card
updateQuestion({ html: translatedHtml });
return;
}
updateQuestion(questionIdx, { html: translatedHtml });
}
updateQuestion(questionIdx, { html: translatedHtml });
}}
/>
{localSurvey.languages.length > 1 && (