diff --git a/src/components/git-sync/steps/SyncStep.tsx b/src/components/git-sync/steps/SyncStep.tsx index 9ea2af6f..c78197bc 100644 --- a/src/components/git-sync/steps/SyncStep.tsx +++ b/src/components/git-sync/steps/SyncStep.tsx @@ -28,9 +28,11 @@ export function SyncStep({ projectId }: StepProps) { const queryClient = useQueryClient(); const [isSyncing, setIsSyncing] = useState(false); + const [currentOperation, setCurrentOperation] = useState(null); const [error, setError] = useState(null); const [copiedUrl, setCopiedUrl] = useState(false); const [syncSuccess, setSyncSuccess] = useState(false); + const [dropdownOpen, setDropdownOpen] = useState(false); const { data: gitStatus } = useGitStatus(projectId); const { settings } = useGitSettings(); @@ -56,6 +58,8 @@ export function SyncStep({ projectId }: StepProps) { if (!originRemote) return; setIsSyncing(true); + setDropdownOpen(false); + setCurrentOperation(operation); setError(null); setSyncSuccess(false); @@ -70,6 +74,7 @@ export function SyncStep({ projectId }: StepProps) { setError(message); } finally { setIsSyncing(false); + setCurrentOperation(null); } }, [originRemote]); @@ -267,11 +272,15 @@ export function SyncStep({ projectId }: StepProps) { {syncSuccess ? : } - Sync + + {isSyncing && currentOperation === 'pull' ? 'Pull' + : isSyncing && currentOperation === 'push' ? 'Push' + : 'Sync'} +
- + - - - - Pull - - - - Push - + +
+ + +