mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-26 20:08:38 +02:00
google drive step3 indexing not starting bug fix
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
|||||||
GoogleDriveConfig,
|
GoogleDriveConfig,
|
||||||
GoogleDriveCredentialJson,
|
GoogleDriveCredentialJson,
|
||||||
GoogleDriveServiceAccountCredentialJson,
|
GoogleDriveServiceAccountCredentialJson,
|
||||||
|
User,
|
||||||
} from "@/lib/types";
|
} from "@/lib/types";
|
||||||
import { linkCredential } from "@/lib/credential";
|
import { linkCredential } from "@/lib/credential";
|
||||||
import { ConnectorForm } from "@/components/admin/connectors/ConnectorForm";
|
import { ConnectorForm } from "@/components/admin/connectors/ConnectorForm";
|
||||||
@@ -276,13 +277,24 @@ const Main = () => {
|
|||||||
refreshCredentials,
|
refreshCredentials,
|
||||||
} = usePublicCredentials();
|
} = usePublicCredentials();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: currentUserData,
|
||||||
|
isLoading: iscurrentUserLoading,
|
||||||
|
error: iscurrentUserError,
|
||||||
|
} = useSWR<User>(
|
||||||
|
"/api/manage/me",
|
||||||
|
fetcher
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
const { popup, setPopup } = usePopup();
|
const { popup, setPopup } = usePopup();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(!appCredentialData && isAppCredentialLoading) ||
|
(!appCredentialData && isAppCredentialLoading) ||
|
||||||
(!serviceAccountKeyData && isServiceAccountKeyLoading) ||
|
(!serviceAccountKeyData && isServiceAccountKeyLoading) ||
|
||||||
(!connectorIndexingStatuses && isConnectorIndexingStatusesLoading) ||
|
(!connectorIndexingStatuses && isConnectorIndexingStatusesLoading) ||
|
||||||
(!credentialsData && isCredentialsLoading)
|
(!credentialsData && isCredentialsLoading) ||
|
||||||
|
(!currentUserData && iscurrentUserLoading)
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto">
|
<div className="mx-auto">
|
||||||
@@ -317,12 +329,21 @@ const Main = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iscurrentUserError || !credentialsData) {
|
||||||
|
return (
|
||||||
|
<div className="mx-auto">
|
||||||
|
<div className="text-red-500">
|
||||||
|
Error loading user profile. Contact an administrator.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
const googleDrivePublicCredential:
|
const googleDrivePublicCredential:
|
||||||
| Credential<GoogleDriveCredentialJson>
|
| Credential<GoogleDriveCredentialJson>
|
||||||
| undefined = credentialsData.find(
|
| undefined = credentialsData.find(
|
||||||
(credential) =>
|
(credential) =>
|
||||||
credential.credential_json?.google_drive_tokens &&
|
credential.credential_json?.google_drive_tokens &&
|
||||||
credential.user_id === null
|
credential.user_id === currentUserData?.id
|
||||||
);
|
);
|
||||||
const googleDriveServiceAccountCredential:
|
const googleDriveServiceAccountCredential:
|
||||||
| Credential<GoogleDriveServiceAccountCredentialJson>
|
| Credential<GoogleDriveServiceAccountCredentialJson>
|
||||||
|
@@ -164,7 +164,7 @@ export interface CredentialBase<T> {
|
|||||||
|
|
||||||
export interface Credential<T> extends CredentialBase<T> {
|
export interface Credential<T> extends CredentialBase<T> {
|
||||||
id: number;
|
id: number;
|
||||||
user_id: number | null;
|
user_id: string | null;
|
||||||
time_created: string;
|
time_created: string;
|
||||||
time_updated: string;
|
time_updated: string;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user