diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-12-07 20:17:30 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-12-07 20:17:30 +0100 |
| commit | fbb4530d7ac980f9b9b54757813c023089f600f8 (patch) | |
| tree | a743bf4ece0bce4fe41f57dd65c19e8ad52c4b66 | |
| parent | d05f5ffb04c8ef553e637fcd9d98477305b2014a (diff) | |
Fix stutter caused by the "setDataLoading" changes. I'm a moron.
| -rw-r--r-- | src/frontend/app/routes/stops-$id.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/frontend/app/routes/stops-$id.tsx b/src/frontend/app/routes/stops-$id.tsx index c674e22..31cc75f 100644 --- a/src/frontend/app/routes/stops-$id.tsx +++ b/src/frontend/app/routes/stops-$id.tsx @@ -126,7 +126,6 @@ export default function Estimates() { const loadData = useCallback(async () => { try { - setDataLoading(true); setDataError(null); const body = await loadConsolidatedData(params.id!); @@ -142,8 +141,6 @@ export default function Estimates() { setDataError(parseError(error)); setData(null); setDataDate(null); - } finally { - setDataLoading(false); } }, [params.id, stopIdNum]); @@ -153,10 +150,12 @@ export default function Estimates() { const handleManualRefresh = useCallback(async () => { try { + setDataLoading(true); setIsManualRefreshing(true); await refreshData(); } finally { setIsManualRefreshing(false); + setDataLoading(false); } }, [refreshData]); @@ -168,12 +167,14 @@ export default function Estimates() { useEffect(() => { // Initial load + setDataLoading(true); loadData(); StopDataProvider.pushRecent(parseInt(params.id ?? "")); setFavourited( StopDataProvider.isFavourite(parseInt(params.id ?? "")) ); + setDataLoading(false); }, [params.id, loadData]); const toggleFavourite = () => { |
