diff --git a/src/components/git-sync/steps/SyncStep.tsx b/src/components/git-sync/steps/SyncStep.tsx index be7c189c..52b2fb48 100644 --- a/src/components/git-sync/steps/SyncStep.tsx +++ b/src/components/git-sync/steps/SyncStep.tsx @@ -79,7 +79,10 @@ export function SyncStep({ projectId, remoteUrl }: SyncStepProps) { setIsSyncing(false); setCurrentOperation(null); } - }, [remoteUrl]); + + // Invalidate git status to refresh UI + queryClient.invalidateQueries({ queryKey: ['git-status', projectId] }); + }, [projectId, queryClient, remoteUrl]); const handleSync = async () => { await executeGitOperation('sync', async () => { @@ -132,9 +135,6 @@ export function SyncStep({ projectId, remoteUrl }: SyncStepProps) { ref, force: true, }); - - // Invalidate git status to refresh UI - queryClient.invalidateQueries({ queryKey: ['git-status', projectId] }); }); };