diff --git a/frontend/src/components/SyncModal.tsx b/frontend/src/components/SyncModal.tsx index 2926347..d90469b 100644 --- a/frontend/src/components/SyncModal.tsx +++ b/frontend/src/components/SyncModal.tsx @@ -34,9 +34,14 @@ export function SyncModal({ onClose }: { onClose: () => void }) { .then((s) => { setStatus(s); setError(null); + // Once a fetched status reports the sync finished, stop polling -- + // the final result is already shown, and there's nothing new left + // to fetch until the user starts another sync ("Close" unmounts + // this component, which is the only other way polling stops). + if (!stoppedRef.current && s.in_progress) timeout = setTimeout(tick, 1500); }) - .catch((e) => setError(String(e))) - .finally(() => { + .catch((e) => { + setError(String(e)); if (!stoppedRef.current) timeout = setTimeout(tick, 1500); }); };