Browse Source

fix(dashboards): Clear GroupStore when unmounting dashboard (#46189)

Clears the GroupStore when unmounting Dashboards. This fixes an issue
where incorrect projects were being loaded when navigating to an issue
from an issue widget
edwardgou-sentry 2 years ago
parent
commit
45b48099af
1 changed files with 2 additions and 0 deletions
  1. 2 0
      static/app/views/dashboards/dashboard.tsx

+ 2 - 0
static/app/views/dashboards/dashboard.tsx

@@ -19,6 +19,7 @@ import {Client} from 'sentry/api';
 import {Button} from 'sentry/components/button';
 import {IconResize} from 'sentry/icons';
 import {t} from 'sentry/locale';
+import GroupStore from 'sentry/stores/groupStore';
 import {space} from 'sentry/styles/space';
 import {Organization, PageFilters} from 'sentry/types';
 import theme from 'sentry/utils/theme';
@@ -163,6 +164,7 @@ class Dashboard extends Component<Props, State> {
   componentWillUnmount() {
     window.removeEventListener('resize', this.debouncedHandleResize);
     window.clearTimeout(this.forceCheckTimeout);
+    GroupStore.reset();
   }
 
   forceCheckTimeout: number | undefined = undefined;