Fix isQueryCopilotSampleContainer flag

This commit is contained in:
Laurent Nguyen 2024-04-22 15:06:27 +02:00
parent 1097e66faa
commit 60a3a5ffcf

View File

@ -119,7 +119,6 @@ const DocumentsTabComponent: React.FunctionComponent<{
applyFilterButtonPressed: boolean;
}>(undefined);
const [queryAbortController, setQueryAbortController] = useState<AbortController>(undefined);
const [isQueryCopilotSampleContainer, setIsQueryCopilotSampleContainer] = useState<boolean>(false); // TODO: Make this a constant is setter getting called
const [cancelQueryTimeoutID, setCancelQueryTimeoutID] = useState<NodeJS.Timeout>(undefined);
const [isExecutionError, setIsExecutionError] = useState<boolean>(false); // TODO: Where is this used?
@ -139,6 +138,11 @@ const DocumentsTabComponent: React.FunctionComponent<{
ViewModels.DocumentExplorerState.noDocumentSelected,
);
const isQueryCopilotSampleContainer =
props.collection?.isSampleCollection &&
props.collection?.databaseId === QueryCopilotSampleDatabaseId &&
props.collection?.id() === QueryCopilotSampleContainerId;
// For Mongo only
const [continuationToken, setContinuationToken] = useState<string>(undefined);