From c6d094b2eeb3b95ece829f582651c5dcfe4889b3 Mon Sep 17 00:00:00 2001 From: Weves Date: Sun, 16 Jun 2024 14:48:27 -0700 Subject: [PATCH] Fix google drive connector page refresh --- .../app/admin/connectors/google-drive/page.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/src/app/admin/connectors/google-drive/page.tsx b/web/src/app/admin/connectors/google-drive/page.tsx index 20bb817fc..121d8af9d 100644 --- a/web/src/app/admin/connectors/google-drive/page.tsx +++ b/web/src/app/admin/connectors/google-drive/page.tsx @@ -293,9 +293,16 @@ const Main = () => { const { popup, setPopup } = usePopup(); + const appCredentialSuccessfullyFetched = + appCredentialData || + (isAppCredentialError && isAppCredentialError.status === 404); + const serviceAccountKeySuccessfullyFetched = + serviceAccountKeyData || + (isServiceAccountKeyError && isServiceAccountKeyError.status === 404); + if ( - (!appCredentialData && isAppCredentialLoading) || - (!serviceAccountKeyData && isServiceAccountKeyLoading) || + (!appCredentialSuccessfullyFetched && isAppCredentialLoading) || + (!serviceAccountKeySuccessfullyFetched && isServiceAccountKeyLoading) || (!connectorIndexingStatuses && isConnectorIndexingStatusesLoading) || (!credentialsData && isCredentialsLoading) ) { @@ -315,8 +322,8 @@ const Main = () => { } if ( - (isAppCredentialError && isAppCredentialError.status !== 404) || - (isServiceAccountKeyError && isServiceAccountKeyError.status !== 404) + !appCredentialSuccessfullyFetched || + !serviceAccountKeySuccessfullyFetched ) { return (