5.3.1: Обновление списка задач Fitbit при открытии меню
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m13s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m13s
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "play-life-web",
|
"name": "play-life-web",
|
||||||
"version": "5.3.0",
|
"version": "5.3.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -173,9 +173,9 @@ function FitbitIntegration({ onNavigate }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadTasks = async () => {
|
const loadTasks = async (silent = false) => {
|
||||||
try {
|
try {
|
||||||
setLoadingTasks(true)
|
if (!silent) setLoadingTasks(true)
|
||||||
const response = await authFetch('/api/tasks')
|
const response = await authFetch('/api/tasks')
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Ошибка при загрузке задач')
|
throw new Error('Ошибка при загрузке задач')
|
||||||
@@ -183,9 +183,9 @@ function FitbitIntegration({ onNavigate }) {
|
|||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
setTasks(data || [])
|
setTasks(data || [])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error loading tasks:', error)
|
if (!silent) console.error('Error loading tasks:', error)
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingTasks(false)
|
if (!silent) setLoadingTasks(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,6 +416,7 @@ function FitbitIntegration({ onNavigate }) {
|
|||||||
...editedBindings,
|
...editedBindings,
|
||||||
steps_task_id: e.target.value ? parseInt(e.target.value, 10) : null
|
steps_task_id: e.target.value ? parseInt(e.target.value, 10) : null
|
||||||
})}
|
})}
|
||||||
|
onFocus={() => loadTasks(true)}
|
||||||
disabled={loadingTasks}
|
disabled={loadingTasks}
|
||||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
|
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_task_id: e.target.value ? parseInt(e.target.value, 10) : null,
|
||||||
steps_goal_subtask_id: null
|
steps_goal_subtask_id: null
|
||||||
})}
|
})}
|
||||||
|
onFocus={() => loadTasks(true)}
|
||||||
disabled={loadingTasks}
|
disabled={loadingTasks}
|
||||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
|
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,
|
...editedBindings,
|
||||||
floors_task_id: e.target.value ? parseInt(e.target.value, 10) : null
|
floors_task_id: e.target.value ? parseInt(e.target.value, 10) : null
|
||||||
})}
|
})}
|
||||||
|
onFocus={() => loadTasks(true)}
|
||||||
disabled={loadingTasks}
|
disabled={loadingTasks}
|
||||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
|
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_task_id: e.target.value ? parseInt(e.target.value, 10) : null,
|
||||||
floors_goal_subtask_id: null
|
floors_goal_subtask_id: null
|
||||||
})}
|
})}
|
||||||
|
onFocus={() => loadTasks(true)}
|
||||||
disabled={loadingTasks}
|
disabled={loadingTasks}
|
||||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
|
className="w-full px-3 py-2 border border-gray-300 rounded-lg disabled:bg-gray-100"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user