mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 01:22:03 +08:00
[Refactor]: added extra param to check isdepend on query build (#4523)
* refactor: added extra param to check isdepend on query build * refactor: added extra param to check isdepend on query build * refactor: updated enabled query condition * refactor: added extra param to check isdepend on query build * refactor: updated enabled query condition * chore: clean code
This commit is contained in:
parent
cff0e1cf1e
commit
ad8924ed13
@ -89,6 +89,8 @@ export default function LogsConnectionStatus(): JSX.Element {
|
||||
refetchInterval: pollingInterval,
|
||||
enabled: true,
|
||||
},
|
||||
{},
|
||||
false,
|
||||
);
|
||||
|
||||
const verifyLogsData = (
|
||||
|
@ -17,6 +17,7 @@ export const useGetExplorerQueryRange = (
|
||||
panelType: PANEL_TYPES | null,
|
||||
options?: UseQueryOptions<SuccessResponse<MetricRangePayloadProps>, Error>,
|
||||
params?: Record<string, unknown>,
|
||||
isDependentOnQB = true,
|
||||
): UseQueryResult<SuccessResponse<MetricRangePayloadProps>, Error> => {
|
||||
const { isEnabledQuery } = useQueryBuilder();
|
||||
const { selectedTime: globalSelectedInterval, minTime, maxTime } = useSelector<
|
||||
@ -32,11 +33,11 @@ export const useGetExplorerQueryRange = (
|
||||
const isEnabled = useMemo(() => {
|
||||
if (!options) return isEnabledQuery;
|
||||
if (typeof options.enabled === 'boolean') {
|
||||
return isEnabledQuery && options.enabled;
|
||||
return options.enabled && (!isDependentOnQB || isEnabledQuery);
|
||||
}
|
||||
|
||||
return isEnabledQuery;
|
||||
}, [options, isEnabledQuery]);
|
||||
}, [options, isEnabledQuery, isDependentOnQB]);
|
||||
|
||||
return useGetQueryRange(
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user