From fe82f365331d40d67601c28b21edf28f6e094187 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 23 Sep 2025 19:12:48 -0500 Subject: [PATCH] Fix double-clone error --- src/pages/Clone.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/Clone.tsx b/src/pages/Clone.tsx index 49142e96..1a3b94f8 100644 --- a/src/pages/Clone.tsx +++ b/src/pages/Clone.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useCallback } from 'react'; +import { useState, useEffect, useCallback, useRef } from 'react'; import { useNavigate, useSearchParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { AppLayout } from '@/components/AppLayout'; @@ -19,6 +19,7 @@ export default function Clone() { const [searchParams] = useSearchParams(); const projectsManager = useProjectsManager(); const { toast } = useToast(); + const autoCloneInitiatedRef = useRef(false); useSeoMeta({ title: `${t('importRepository')} - Shakespeare`, @@ -160,9 +161,10 @@ export default function Clone() { // Initialize repoUrl from URL parameters and auto-import if URL is provided useEffect(() => { const urlParam = searchParams.get('url'); - if (urlParam) { + if (urlParam && !autoCloneInitiatedRef.current) { const decodedUrl = decodeURIComponent(urlParam); setRepoUrl(decodedUrl); + autoCloneInitiatedRef.current = true; // Automatically start the clone process with the URL directly handleClone(decodedUrl);