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:
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user