Browse Source

fix(discover): Ensure org tags are loaded in Discover (#26273)

Alberto Leal 3 years ago
parent
commit
2a641cf7d3
1 changed files with 5 additions and 3 deletions
  1. 5 3
      static/app/views/eventsV2/results.tsx

+ 5 - 3
static/app/views/eventsV2/results.tsx

@@ -99,8 +99,8 @@ class Results extends React.Component<Props, State> {
   };
 
   componentDidMount() {
-    const {api, organization, selection} = this.props;
-    loadOrganizationTags(api, organization.slug, selection);
+    const {organization, selection} = this.props;
+    loadOrganizationTags(this.tagsApi, organization.slug, selection);
     addRoutePerformanceContext(selection);
     this.checkEventView();
     this.canLoadEvents();
@@ -124,13 +124,15 @@ class Results extends React.Component<Props, State> {
       !isEqual(prevProps.selection.datetime, selection.datetime) ||
       !isEqual(prevProps.selection.projects, selection.projects)
     ) {
-      loadOrganizationTags(api, organization.slug, selection);
+      loadOrganizationTags(this.tagsApi, organization.slug, selection);
       addRoutePerformanceContext(selection);
     }
 
     if (prevState.confirmedQuery !== confirmedQuery) this.fetchTotalCount();
   }
 
+  tagsApi: Client = new Client();
+
   hasChartParametersChanged(prevEventView: EventView, eventView: EventView) {
     const prevYAxisValue = prevEventView.getYAxis();
     const yAxisValue = eventView.getYAxis();