From 2b16a8573ec6c70981b234afdcdc7eb4f206ea28 Mon Sep 17 00:00:00 2001 From: Drobysh Date: Tue, 22 Sep 2026 16:01:28 +0300 Subject: [PATCH] =?UTF-8?q?fix(teacher):=20=D0=BD=D0=B5=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=20currentQuestionId=20=D0=BF=D1=80=D0=B8=20resume?= =?UTF-8?q?=20(22.09.2026)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/TeacherChatPage.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pages/TeacherChatPage.tsx b/src/pages/TeacherChatPage.tsx index 1fd11ad..5060a79 100644 --- a/src/pages/TeacherChatPage.tsx +++ b/src/pages/TeacherChatPage.tsx @@ -177,16 +177,25 @@ const TeacherChatPage: React.FC = () => { if (resumeData.has_active_session && resumeData.question) { setSessionId(resumeData.session_id || null); setCurrentTopicId(resumeData.topic_id || ''); - setCurrentQuestionId(resumeData.question.question.question_id); setIsStarted(true); const questionId = resumeData.question.question.question_id; + + // 🔧 ФИКС (22.09.2026): НЕ перезаписываем currentQuestionId, + // если активный вопрос уже в истории. Иначе localStorage и resume + // расходятся (UI показывает один вопрос, state хранит другой). setMessages(prev => { - const alreadyExists = prev.some(m => m.isQuestion && m.questionId === questionId); - if (alreadyExists) { + const existingQuestion = [...prev].reverse().find(m => m.isQuestion); + + if (existingQuestion) { + // Уже есть активный вопрос в истории — используем ЕГО ID. + setCurrentQuestionId(existingQuestion.questionId || questionId); return prev; } + // Иначе — используем ID из resume. + setCurrentQuestionId(questionId); + const questionMsg: TeacherMessage = { id: idRef.current++, type: 'bot',