Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadshaheer committed Dec 20, 2024
1 parent 733e13c commit 753824b
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions frontend/src/providers/QueryBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,7 @@ export function QueryBuilderProvider({
const urlQuery = useUrlQuery();
const history = useHistory();
const location = useLocation();
/**
// set location.pathname as the initial value for currentPathnameRef, absense of this causes `stagedQuery && location.pathname !== currentPathnameRef.current` to be truthy (since currentPathnameRef.current is null), and therefore causes duplicate triggering of initQueryBuilderData(compositeQueryParam); in the useEffect of line ~784
if (!isValid) {
redirectWithQueryBuilderData(validData);
} else {
initQueryBuilderData(compositeQueryParam);
}
*
*/

const currentPathnameRef = useRef<string | null>(location.pathname);

const { maxTime, minTime } = useSelector<AppState, GlobalReducer>(
Expand Down Expand Up @@ -243,7 +234,6 @@ export function QueryBuilderProvider({
timeUpdated ? merge(currentQuery, newQueryState) : newQueryState,
);
setQueryType(type);
// debugger;
},
[prepareQueryBuilderData, currentQuery],
);
Expand Down Expand Up @@ -803,7 +793,6 @@ export function QueryBuilderProvider({
initialQueriesMap.metrics,
);

// debugger;
if (!isValid) {
redirectWithQueryBuilderData(validData);
} else {
Expand Down

0 comments on commit 753824b

Please sign in to comment.