From 60a3a5ffcf1724e5dbb50f03e86e584f5d86225b Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Mon, 22 Apr 2024 15:06:27 +0200 Subject: [PATCH] Fix isQueryCopilotSampleContainer flag --- src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx index 5c08d0ad6..723761a0d 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx @@ -119,7 +119,6 @@ const DocumentsTabComponent: React.FunctionComponent<{ applyFilterButtonPressed: boolean; }>(undefined); const [queryAbortController, setQueryAbortController] = useState(undefined); - const [isQueryCopilotSampleContainer, setIsQueryCopilotSampleContainer] = useState(false); // TODO: Make this a constant is setter getting called const [cancelQueryTimeoutID, setCancelQueryTimeoutID] = useState(undefined); const [isExecutionError, setIsExecutionError] = useState(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(undefined);