From 4f49c8efb4ae21a1001fc3722156914572b0efa1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 22 Dec 2025 20:11:21 -0600 Subject: [PATCH] Remove unnecessary onRefetchStatus props --- src/components/git-sync/GitSyncSteps.tsx | 8 +------- src/components/git-sync/steps/ConfigureRepoStep.tsx | 7 +++---- src/components/git-sync/steps/SyncStep.tsx | 4 ++-- src/components/git-sync/types.ts | 6 +----- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/components/git-sync/GitSyncSteps.tsx b/src/components/git-sync/GitSyncSteps.tsx index 466ca500..7aba2d12 100644 --- a/src/components/git-sync/GitSyncSteps.tsx +++ b/src/components/git-sync/GitSyncSteps.tsx @@ -12,7 +12,7 @@ interface GitSyncStepsProps { } export function GitSyncSteps({ projectId, onClose }: GitSyncStepsProps) { - const { data: gitStatus, isLoading: isGitStatusLoading, refetch: refetchGitStatus } = useGitStatus(projectId); + const { data: gitStatus, isLoading: isGitStatusLoading } = useGitStatus(projectId); // Determine if we have a remote configured const originRemote = gitStatus?.remotes.find(r => r.name === 'origin'); @@ -52,10 +52,6 @@ export function GitSyncSteps({ projectId, onClose }: GitSyncStepsProps) { setCurrentStep('init-success'); }; - const handleRefetchStatus = async () => { - await refetchGitStatus(); - }; - // Don't render anything while loading git status if (isGitStatusLoading) { return ( @@ -86,7 +82,6 @@ export function GitSyncSteps({ projectId, onClose }: GitSyncStepsProps) { onSuccess={handleSuccess} onChangeStep={setCurrentStep} onClose={onClose} - onRefetchStatus={handleRefetchStatus} /> ); } @@ -97,7 +92,6 @@ export function GitSyncSteps({ projectId, onClose }: GitSyncStepsProps) { projectId={projectId} onChangeStep={setCurrentStep} onClose={onClose} - onRefetchStatus={handleRefetchStatus} /> ); } diff --git a/src/components/git-sync/steps/ConfigureRepoStep.tsx b/src/components/git-sync/steps/ConfigureRepoStep.tsx index 07813af7..c022ad7a 100644 --- a/src/components/git-sync/steps/ConfigureRepoStep.tsx +++ b/src/components/git-sync/steps/ConfigureRepoStep.tsx @@ -16,8 +16,7 @@ export function ConfigureRepoStep({ onBack, onSuccess, onClose, - onRefetchStatus, -}: ConfigureRepoStepProps & { onRefetchStatus: () => void }) { +}: ConfigureRepoStepProps) { const [repositoryUrl, setRepositoryUrl] = useState(''); const [isPushing, setIsPushing] = useState(false); const [error, setError] = useState(null); @@ -25,7 +24,7 @@ export function ConfigureRepoStep({ const { user } = useCurrentUser(); const { git } = useGit(); const { projectsPath } = useFSPaths(); - const { data: gitStatus } = useGitStatus(projectId); + const { data: gitStatus, refetch: refetchGitStatus } = useGitStatus(projectId); const handlePushInitial = async () => { setIsPushing(true); @@ -78,7 +77,7 @@ export function ConfigureRepoStep({ } // Refresh git status before showing success - await onRefetchStatus(); + await refetchGitStatus(); // Show success state onSuccess(); } catch (err) { diff --git a/src/components/git-sync/steps/SyncStep.tsx b/src/components/git-sync/steps/SyncStep.tsx index c5f2c96e..a74d7ce4 100644 --- a/src/components/git-sync/steps/SyncStep.tsx +++ b/src/components/git-sync/steps/SyncStep.tsx @@ -9,9 +9,9 @@ import { useGitStatus } from '@/hooks/useGitStatus'; import { useGitSettings } from '@/hooks/useGitSettings'; import { useGit } from '@/hooks/useGit'; import { useFSPaths } from '@/hooks/useFSPaths'; -import type { SyncStepProps } from '../types'; +import type { StepProps } from '../types'; -export function SyncStep({ projectId }: SyncStepProps) { +export function SyncStep({ projectId }: StepProps) { const [isPushing, setIsPushing] = useState(false); const [error, setError] = useState(null); const [copiedUrl, setCopiedUrl] = useState(false); diff --git a/src/components/git-sync/types.ts b/src/components/git-sync/types.ts index 54390e6d..c09cce7e 100644 --- a/src/components/git-sync/types.ts +++ b/src/components/git-sync/types.ts @@ -28,8 +28,4 @@ export interface ConfigureRepoStepProps extends StepProps { selectedProvider: ProviderOption; onBack: () => void; onSuccess: () => void; -} - -export interface SyncStepProps extends StepProps { - onRefetchStatus: () => void; -} +} \ No newline at end of file