mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 23:02:01 +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,
|
refetchInterval: pollingInterval,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
{},
|
||||||
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
const verifyLogsData = (
|
const verifyLogsData = (
|
||||||
|
@ -17,6 +17,7 @@ export const useGetExplorerQueryRange = (
|
|||||||
panelType: PANEL_TYPES | null,
|
panelType: PANEL_TYPES | null,
|
||||||
options?: UseQueryOptions<SuccessResponse<MetricRangePayloadProps>, Error>,
|
options?: UseQueryOptions<SuccessResponse<MetricRangePayloadProps>, Error>,
|
||||||
params?: Record<string, unknown>,
|
params?: Record<string, unknown>,
|
||||||
|
isDependentOnQB = true,
|
||||||
): UseQueryResult<SuccessResponse<MetricRangePayloadProps>, Error> => {
|
): UseQueryResult<SuccessResponse<MetricRangePayloadProps>, Error> => {
|
||||||
const { isEnabledQuery } = useQueryBuilder();
|
const { isEnabledQuery } = useQueryBuilder();
|
||||||
const { selectedTime: globalSelectedInterval, minTime, maxTime } = useSelector<
|
const { selectedTime: globalSelectedInterval, minTime, maxTime } = useSelector<
|
||||||
@ -32,11 +33,11 @@ export const useGetExplorerQueryRange = (
|
|||||||
const isEnabled = useMemo(() => {
|
const isEnabled = useMemo(() => {
|
||||||
if (!options) return isEnabledQuery;
|
if (!options) return isEnabledQuery;
|
||||||
if (typeof options.enabled === 'boolean') {
|
if (typeof options.enabled === 'boolean') {
|
||||||
return isEnabledQuery && options.enabled;
|
return options.enabled && (!isDependentOnQB || isEnabledQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
return isEnabledQuery;
|
return isEnabledQuery;
|
||||||
}, [options, isEnabledQuery]);
|
}, [options, isEnabledQuery, isDependentOnQB]);
|
||||||
|
|
||||||
return useGetQueryRange(
|
return useGetQueryRange(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user