mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Remove unnecessary onRefetchStatus props
This commit is contained in:
4 files changed
+7
-18
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -28,8 +28,4 @@ export interface ConfigureRepoStepProps extends StepProps {
|
||||
selectedProvider: ProviderOption;
|
||||
onBack: () => void;
|
||||
onSuccess: () => void;
|
||||
}
|
||||
|
||||
export interface SyncStepProps extends StepProps {
|
||||
onRefetchStatus: () => void;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user