Исправлена передача maxCards в тестах, версия 3.14.9
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 47s

This commit is contained in:
poignatov
2026-01-19 22:02:00 +03:00
parent bea0e17133
commit cd61fe4766
3 changed files with 23 additions and 5 deletions

View File

@@ -1 +1 @@
3.14.8
3.14.9

View File

@@ -1,6 +1,6 @@
{
"name": "play-life-web",
"version": "3.14.8",
"version": "3.14.9",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -36,16 +36,34 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
const handleCheckmarkClick = async (task, e) => {
e.stopPropagation()
// Для задач-тестов запускаем тест вместо открытия модального окна
const isTest = task.config_id != null
if (isTest) {
if (task.config_id) {
onNavigate?.('test', { configId: task.config_id, taskId: task.id })
try {
// Загружаем детальную информацию о задаче, чтобы получить maxCards
const response = await authFetch(`${API_URL}/${task.id}`)
if (!response.ok) {
throw new Error('Ошибка при загрузке деталей задачи')
}
const taskDetail = await response.json()
// Переходим к тесту с maxCards
onNavigate?.('test', {
configId: task.config_id,
taskId: task.id,
maxCards: taskDetail.max_cards
})
} catch (err) {
console.error('Failed to load task details:', err)
// В случае ошибки всё равно переходим к тесту, но без maxCards
onNavigate?.('test', { configId: task.config_id, taskId: task.id })
}
}
return
}
// Для обычных задач открываем диалог подтверждения
setSelectedTaskForDetail(task.id)
}