diff --git a/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx b/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx index 12f21e6700fb..31566f034379 100644 --- a/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx +++ b/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx @@ -49,6 +49,7 @@ import { useRouter } from "next/navigation"; import CardSection from "@/components/admin/CardSection"; import { prepareOAuthAuthorizationRequest } from "@/lib/oauth_utils"; import { EE_ENABLED, NEXT_PUBLIC_CLOUD_ENABLED } from "@/lib/constants"; +import TemporaryLoadingModal from "@/components/TemporaryLoadingModal"; import { getConnectorOauthRedirectUrl } from "@/lib/connectors/oauth"; export interface AdvancedConfig { refreshFreq: number; @@ -161,6 +162,7 @@ export default function AddConnector({ // Form context and popup management const { setFormStep, setAllowCreate, formStep } = useFormContext(); const { popup, setPopup } = usePopup(); + const [uploading, setUploading] = useState(false); // Hooks for Google Drive and Gmail credentials const { liveGDriveCredential } = useGoogleDriveCredentials(connector); @@ -338,16 +340,24 @@ export default function AddConnector({ } // File-specific handling if (connector == "file") { - const response = await submitFiles( - selectedFiles, - setPopup, - name, - access_type, - groups - ); - if (response) { - onSuccess(); + setUploading(true); + try { + const response = await submitFiles( + selectedFiles, + setPopup, + name, + access_type, + groups + ); + if (response) { + onSuccess(); + } + } catch (error) { + setPopup({ message: "Error uploading files", type: "error" }); + } finally { + setUploading(false); } + return; } @@ -409,9 +419,9 @@ export default function AddConnector({
{content}
+