Remove unnecessary onRefetchStatus props

This commit is contained in:
Alex Gleason committed 2025-12-22 20:11:21 -06:00
1 parent bd97dda7ab
commit 4f49c8efb4
4 files changed
+7 -18

No files matched your search

+1 -7
View File
@@ -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}
/>
);
}
@@ -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<string | null>(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) {
+2 -2
View File
@@ -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<string | null>(null);
const [copiedUrl, setCopiedUrl] = useState(false);
+1 -5
View File
@@ -28,8 +28,4 @@ export interface ConfigureRepoStepProps extends StepProps {
selectedProvider: ProviderOption;
onBack: () => void;
onSuccess: () => void;
}
export interface SyncStepProps extends StepProps {
onRefetchStatus: () => void;
}
}