diff --git a/.changeset/fair-pugs-melt.md b/.changeset/fair-pugs-melt.md new file mode 100644 index 0000000000..8f58a485eb --- /dev/null +++ b/.changeset/fair-pugs-melt.md @@ -0,0 +1,5 @@ +--- +"@hyperdx/app": patch +--- + +fix: Respect date range URL params on Services dashboard diff --git a/packages/app/src/ServicesDashboardPage.tsx b/packages/app/src/ServicesDashboardPage.tsx index 3efea25af0..1f59a54f6a 100644 --- a/packages/app/src/ServicesDashboardPage.tsx +++ b/packages/app/src/ServicesDashboardPage.tsx @@ -1480,19 +1480,22 @@ function ServicesDashboardPage() { isLive, }); - const onSubmit = useCallback(() => { - onSearch(displayedTimeInputValue); - handleSubmit(values => { - setAppliedConfigParams(values); - })(); - }, [handleSubmit, setAppliedConfigParams, onSearch, displayedTimeInputValue]); + const onSubmit = useCallback( + (submitTime: boolean = true) => { + if (submitTime) onSearch(displayedTimeInputValue); + handleSubmit(values => { + setAppliedConfigParams(values); + })(); + }, + [handleSubmit, setAppliedConfigParams, onSearch, displayedTimeInputValue], + ); // Auto-submit when source changes // Note: do not include appliedConfig.source in the deps, // to avoid infinite render loops when navigating away from the page useEffect(() => { if (sourceId && sourceId != previousSourceId) { - onSubmit(); + onSubmit(false); } }, [sourceId, onSubmit, previousSourceId]); @@ -1501,7 +1504,7 @@ function ServicesDashboardPage() { // to avoid infinite render loops when navigating away from the page useEffect(() => { if (service != previousService) { - onSubmit(); + onSubmit(false); } }, [service, onSubmit, previousService]);