fix: refresh catalog after hidden sync completion

This commit is contained in:
Codex
2026-09-02 23:23:00 +02:00
parent a50475d687
commit 7b87e95427
3 changed files with 185 additions and 15 deletions
@@ -25,7 +25,7 @@ interface Props {
onClose: () => void;
onRunChange: (run: CatalogSyncRun) => void;
onRunUpdate: (run: CatalogSyncRun) => void;
onCatalogChanged: () => void;
onCatalogChanged: (run: CatalogSyncRun) => void;
}
const phases: CatalogSyncPhase[] = [
@@ -102,7 +102,7 @@ export function CatalogSyncDrawer({
const runQuery = useQuery({
queryKey: ["catalog-sync-run", runId],
queryFn: () => getCatalogSyncRun(runId!),
enabled: Boolean(runId && open),
enabled: Boolean(runId),
retry: false,
refetchInterval: (query) => terminal(query.state.data) ? false : 1_000,
});
@@ -185,7 +185,7 @@ export function CatalogSyncDrawer({
useEffect(() => {
if (!run || run.state !== "succeeded" || notifiedRun.current === run.id) return;
notifiedRun.current = run.id;
onCatalogChanged();
onCatalogChanged(run);
}, [onCatalogChanged, run]);
const currentPhase = run ? phases.indexOf(run.phase) : -1;