Skip to content

Commit

Permalink
fix: [SigNozGH-3790]: handle multiple query calls
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 authored and YounixM committed Dec 14, 2023
1 parent 7b798d2 commit 57d4162
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions frontend/src/container/TopNav/DateTimeSelection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import dayjs, { Dayjs } from 'dayjs';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { updateStepInterval } from 'hooks/queryBuilder/useStepInterval';
import useUrlQuery from 'hooks/useUrlQuery';
import createQueryParams from 'lib/createQueryParams';
import GetMinMax from 'lib/getMinMax';
import getTimeString from 'lib/getTimeString';
import history from 'lib/history';
Expand Down Expand Up @@ -196,10 +195,7 @@ function DateTimeSelection({
if (!isLogsExplorerPage) {
urlQuery.set(QueryParams.startTime, minTime.toString());
urlQuery.set(QueryParams.endTime, maxTime.toString());
const generatedUrl = `${location.pathname}?${createQueryParams({
startTime: minTime.toString(),
endTime: maxTime.toString(),
})}`;
const generatedUrl = `${location.pathname}?${urlQuery.toString()}`;
history.replace(generatedUrl);
}

Expand Down Expand Up @@ -227,10 +223,9 @@ function DateTimeSelection({
setLocalStorageKey('endTime', endTimeMoment.toString());
updateLocalStorageForRoutes('custom');
if (!isLogsExplorerPage) {
const generatedUrl = `${location.pathname}?${createQueryParams({
startTime: startTimeMoment.toString(),
endTime: endTimeMoment.toString(),
})}`;
urlQuery.set(QueryParams.startTime, minTime.toString());
urlQuery.set(QueryParams.endTime, maxTime.toString());
const generatedUrl = `${location.pathname}?${urlQuery.toString()}`;
history.replace(generatedUrl);
}
}
Expand Down

0 comments on commit 57d4162

Please sign in to comment.