From 06ddfae6cae47984e6ca1ea370df5a935c7f5a0b Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 4 Jun 2024 15:19:11 +0800 Subject: [PATCH] Improve enabled check on ongoing queries (#26984) --- .../components/interfaces/SQLEditor/OngoingQueriesPanel.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/SQLEditor/OngoingQueriesPanel.tsx b/apps/studio/components/interfaces/SQLEditor/OngoingQueriesPanel.tsx index 4f4db881c9c..34eba6240e1 100644 --- a/apps/studio/components/interfaces/SQLEditor/OngoingQueriesPanel.tsx +++ b/apps/studio/components/interfaces/SQLEditor/OngoingQueriesPanel.tsx @@ -25,6 +25,7 @@ import { import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal' import AlertError from 'components/ui/AlertError' import { ResponseError } from 'types' +import { IS_PLATFORM } from 'lib/constants' interface OngoingQueriesPanel { visible: boolean @@ -51,7 +52,10 @@ export const OngoingQueriesPanel = ({ visible, onClose }: OngoingQueriesPanel) = projectRef: project?.ref, connectionString: database?.connectionString, }, - { staleTime: 5000 } + { + enabled: !IS_PLATFORM || (IS_PLATFORM && database?.connectionString !== undefined), + staleTime: 5000, + } ) const queries = data ?? []