From b688cfc65a8c29d4e5fc69c8ab0e8430ecbea020 Mon Sep 17 00:00:00 2001 From: Koustav Date: Fri, 7 Feb 2025 12:33:48 +0530 Subject: [PATCH] remove redundant alerts api call --- src/hooks/useAlertsEditor.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useAlertsEditor.tsx b/src/hooks/useAlertsEditor.tsx index 256b7e72..15b39190 100644 --- a/src/hooks/useAlertsEditor.tsx +++ b/src/hooks/useAlertsEditor.tsx @@ -5,14 +5,14 @@ import { AxiosError, isAxiosError } from 'axios'; import { useStreamStore, streamStoreReducers } from '@/pages/Stream/providers/StreamProvider'; const { setAlertsConfig } = streamStoreReducers; -const useAlertsQuery = (streamName: string, hasAlertsAccess: boolean, isStandAloneMode: boolean | null) => { +const useAlertsQuery = (streamName: string, hasAlertsAccess: boolean, _isStandAloneMode: boolean | null) => { const [, setStreamStore] = useStreamStore(() => null); const { data, isError, isSuccess, isLoading, refetch } = useQuery( ['fetch-log-stream-alert', streamName, hasAlertsAccess], () => getLogStreamAlerts(streamName), { retry: false, - enabled: streamName !== '' && hasAlertsAccess && !!isStandAloneMode, + enabled: false, refetchOnWindowFocus: false, onSuccess: (data) => { setStreamStore((store) => setAlertsConfig(store, data));