diff --git a/apps/web/app/s/[surveyId]/LinkSurvey.tsx b/apps/web/app/s/[surveyId]/LinkSurvey.tsx index 1c9f9c9fb9..84121d0450 100644 --- a/apps/web/app/s/[surveyId]/LinkSurvey.tsx +++ b/apps/web/app/s/[surveyId]/LinkSurvey.tsx @@ -140,11 +140,9 @@ export default function LinkSurvey({ survey }: LinkSurveyProps) { const submitResponse = async (data: { [x: string]: any }) => { setLoadingElement(true); - // const questionIdx = survey.questions.findIndex((e) => e.id === currentQuestion?.id); const nextQuestionId = getNextQuestionId(data); - console.log(nextQuestionId); - const finished = nextQuestionId === "end"; //|| questionIdx === survey.questions.length - 1; + const finished = nextQuestionId === "end"; // build response const responseRequest = { surveyId: survey.id, diff --git a/packages/js/src/components/SurveyView.tsx b/packages/js/src/components/SurveyView.tsx index 42009a6bcf..d36ec716d0 100644 --- a/packages/js/src/components/SurveyView.tsx +++ b/packages/js/src/components/SurveyView.tsx @@ -164,10 +164,9 @@ export default function SurveyView({ config, survey, close, errorHandler }: Surv const submitResponse = async (data: { [x: string]: any }) => { setLoadingElement(true); - // const questionIdx = survey.questions.findIndex((e) => e.id === activeQuestionId); const nextQuestionId = getNextQuestion(data); - const finished = nextQuestionId === "end"; // || questionIdx === survey.questions.length - 1; + const finished = nextQuestionId === "end"; // build response const responseRequest = { surveyId: survey.id, @@ -193,7 +192,6 @@ export default function SurveyView({ config, survey, close, errorHandler }: Surv setLoadingElement(false); if (!finished && nextQuestionId !== "end") { - // setActiveQuestionId(survey.questions[questionIdx + 1].id); setActiveQuestionId(nextQuestionId); } else { setProgress(100);