File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
static/app/views/dashboards Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {useParams} from 'sentry/utils/useParams';
18
18
19
19
import { assignTempId } from './layoutUtils' ;
20
20
import type { DashboardDetails , DashboardListItem } from './types' ;
21
- import { hasSavedPageFilters } from './utils' ;
21
+ import { getCurrentPageFilters , hasSavedPageFilters } from './utils' ;
22
22
23
23
type OrgDashboardsChildrenProps = {
24
24
dashboard : DashboardDetails | null ;
@@ -93,11 +93,15 @@ function OrgDashboards(props: Props) {
93
93
useEffect ( ( ) => {
94
94
// Only redirect if there are saved filters and none of the filters
95
95
// appear in the query params
96
+
97
+ // current filters based on location
98
+ const locationFilters = getCurrentPageFilters ( location ) ;
96
99
if (
97
100
! selectedDashboard ||
98
101
! hasSavedPageFilters ( selectedDashboard ) ||
99
102
// Apply redirect once for each dashboard id
100
- dashboardRedirectRef . current === selectedDashboard . id
103
+ dashboardRedirectRef . current === selectedDashboard . id ||
104
+ hasSavedPageFilters ( locationFilters )
101
105
) {
102
106
return ;
103
107
}
Original file line number Diff line number Diff line change @@ -454,7 +454,12 @@ export function isWidgetUsingTransactionName(widget: Widget) {
454
454
) ;
455
455
}
456
456
457
- export function hasSavedPageFilters ( dashboard : DashboardDetails ) {
457
+ export function hasSavedPageFilters (
458
+ dashboard : Pick <
459
+ DashboardDetails ,
460
+ 'projects' | 'environment' | 'period' | 'start' | 'end' | 'utc'
461
+ >
462
+ ) {
458
463
return ! (
459
464
( dashboard . projects === undefined || dashboard . projects . length === 0 ) &&
460
465
dashboard . environment === undefined &&
You can’t perform that action at this time.
0 commit comments