5.3.1: Обновление списка задач Fitbit при открытии меню
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m13s

This commit is contained in:
poignatov
2026-02-24 15:50:41 +03:00
parent 07c4deaf70
commit 2236f95ffa
3 changed files with 10 additions and 6 deletions

View File

@@ -1 +1 @@
5.3.0
5.3.1

View File

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

View File

@@ -173,9 +173,9 @@ function FitbitIntegration({ onNavigate }) {
}
}
const loadTasks = async () => {
const loadTasks = async (silent = false) => {
try {
setLoadingTasks(true)
if (!silent) setLoadingTasks(true)
const response = await authFetch('/api/tasks')
if (!response.ok) {
throw new Error('Ошибка при загрузке задач')
@@ -183,9 +183,9 @@ function FitbitIntegration({ onNavigate }) {
const data = await response.json()
setTasks(data || [])
} catch (error) {
console.error('Error loading tasks:', error)
if (!silent) console.error('Error loading tasks:', error)
} finally {
setLoadingTasks(false)
if (!silent) setLoadingTasks(false)
}
}
@@ -416,6 +416,7 @@ function FitbitIntegration({ onNavigate }) {
...editedBindings,
steps_task_id: e.target.value ? parseInt(e.target.value, 10) : null
})}
onFocus={() => loadTasks(true)}
disabled={loadingTasks}
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
>
@@ -438,6 +439,7 @@ function FitbitIntegration({ onNavigate }) {
steps_goal_task_id: e.target.value ? parseInt(e.target.value, 10) : null,
steps_goal_subtask_id: null
})}
onFocus={() => loadTasks(true)}
disabled={loadingTasks}
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
>
@@ -510,6 +512,7 @@ function FitbitIntegration({ onNavigate }) {
...editedBindings,
floors_task_id: e.target.value ? parseInt(e.target.value, 10) : null
})}
onFocus={() => loadTasks(true)}
disabled={loadingTasks}
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
>
@@ -532,6 +535,7 @@ function FitbitIntegration({ onNavigate }) {
floors_goal_task_id: e.target.value ? parseInt(e.target.value, 10) : null,
floors_goal_subtask_id: null
})}
onFocus={() => loadTasks(true)}
disabled={loadingTasks}
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
>