From 93746666b5a39362d1fd1a85009efec426ee38aa Mon Sep 17 00:00:00 2001 From: Christophe Vila Date: Sun, 19 Jul 2026 12:45:03 +0200 Subject: [PATCH] Reload the page after Reset all finishes Other pages (Review Queue, Activities) fetch their own data once on mount and had no way to know activities were deleted elsewhere, so they kept showing stale rows until a manual reload. --- frontend/src/components/GarminConnection.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/GarminConnection.tsx b/frontend/src/components/GarminConnection.tsx index 4f09a27..3e68689 100644 --- a/frontend/src/components/GarminConnection.tsx +++ b/frontend/src/components/GarminConnection.tsx @@ -89,10 +89,17 @@ export function GarminConnection() { setError(null); try { await api.resetSync(); - refreshStatus(); + // Reset runs as a background sync job; wait for it to actually finish + // before reloading, otherwise other pages (e.g. Review Queue) would + // still show the just-deleted activities from their own stale state. + let status = await api.syncStatus(); + while (status.in_progress) { + await new Promise((resolve) => setTimeout(resolve, 300)); + status = await api.syncStatus(); + } + window.location.reload(); } catch (e) { setError(String(e)); - } finally { setBusy(false); } }