Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fair-pugs-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---

fix: Respect date range URL params on Services dashboard
19 changes: 11 additions & 8 deletions packages/app/src/ServicesDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -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]);

Expand Down
Loading