diff --git a/web/src/app/admin/connectors/gmail/page.tsx b/web/src/app/admin/connectors/gmail/page.tsx index e81db40047ce..f0800d293e43 100644 --- a/web/src/app/admin/connectors/gmail/page.tsx +++ b/web/src/app/admin/connectors/gmail/page.tsx @@ -141,9 +141,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) ) { @@ -170,7 +177,10 @@ const Main = () => { ); } - if (isAppCredentialError || isServiceAccountKeyError) { + if ( + !appCredentialSuccessfullyFetched || + !serviceAccountKeySuccessfullyFetched + ) { return (