From 20773a29b775bbd8d92e593575f7f738a1f5ad6d Mon Sep 17 00:00:00 2001 From: poignatov Date: Wed, 4 Mar 2026 18:28:08 +0300 Subject: [PATCH] =?UTF-8?q?5.11.2:=20=D0=A1=D0=BB=D1=83=D1=87=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D1=81=D1=82=D0=BE=D1=80=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=BA=D0=B0=D1=80=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=BC=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA=D0=B0=D0=B7=D0=B5=20=D1=81=D0=BB=D0=BE=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- play-life-web/package.json | 2 +- play-life-web/src/components/TestWords.jsx | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index 32447ce..a87467f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.11.1 +5.11.2 diff --git a/play-life-web/package.json b/play-life-web/package.json index ce5f72a..ef503f3 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "5.11.1", + "version": "5.11.2", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/components/TestWords.jsx b/play-life-web/src/components/TestWords.jsx index 35597b5..2c46e85 100644 --- a/play-life-web/src/components/TestWords.jsx +++ b/play-life-web/src/components/TestWords.jsx @@ -34,6 +34,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC const cardsShownRef = useRef(0) // Синхронный счётчик для избежания race condition const saveProgressPromiseRef = useRef(null) // Промис сохранения прогресса (null = ещё не запущено) const savePayloadRef = useRef(null) // Данные для сохранения при нажатии «Закончить» (если сохранение ещё не запускали) + const [currentSide, setCurrentSide] = useState(null) // Текущая случайная сторона карточки ('word' или 'translation') // Функция равномерного распределения слов в пуле с гарантией максимального расстояния между одинаковыми словами // excludeFirstWordId - ID слова, которое не должно быть первым в пуле (только что показанная карточка) @@ -213,6 +214,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC setWords([]) setTestWords([]) setCurrentWord(null) + setCurrentSide(null) setFlippedCards(new Set()) setWordStats({}) wordStatsRef.current = {} @@ -437,6 +439,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC cardsShownRef.current = nextCardsShown setCurrentWord(validWord) + setCurrentSide(Math.random() < 0.5 ? 'word' : 'translation') setCardsShown(nextCardsShown) setFlippedCards(new Set()) @@ -450,6 +453,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC // showCard: показываем карточку setCurrentWord(nextWord) + setCurrentSide(Math.random() < 0.5 ? 'word' : 'translation') setCardsShown(nextCardsShown) setFlippedCards(new Set()) @@ -604,9 +608,6 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC } } - const getRandomSide = (word) => { - return word.id % 2 === 0 ? 'word' : 'translation' - } return (
@@ -741,10 +742,9 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC loadWords() }} /> )} - {!loading && !error && !isFinishingRef.current && currentWord && (() => { + {!loading && !error && !isFinishingRef.current && currentWord && currentSide && (() => { const word = currentWord const isFlipped = flippedCards.has(word.id) - const showSide = getRandomSide(word) return (
@@ -754,7 +754,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC >
- {showSide === 'word' ? ( + {currentSide === 'word' ? (
{word.name}
) : (
{word.translation}
@@ -763,7 +763,7 @@ function TestWords({ onNavigate, wordCount: initialWordCount, configId: initialC
- {showSide === 'word' ? ( + {currentSide === 'word' ? (
{word.translation}
) : (
{word.name}