Skip to content
Merged
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
10 changes: 8 additions & 2 deletions frontend/public/components/overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class OverviewMainContent_ extends React.Component<OverviewMainContentProps, Ove
} = this.props;
const {filterValue, selectedGroup} = this.state;

if (!_.isEqual(namespace, prevProps.namespace)
if (namespace !== prevProps.namespace
|| loaded !== prevProps.loaded
|| !_.isEqual(buildConfigs, prevProps.buildConfigs)
|| !_.isEqual(builds, prevProps.builds)
Expand Down Expand Up @@ -495,9 +495,15 @@ class OverviewMainContent_ extends React.Component<OverviewMainContentProps, Ove
// OverviewHeading doesn't keep the value in state.
this.setState({ filterValue: '' });
}

// Fetch new metrics when the namespace changes.
if (namespace !== prevProps.namespace) {
clearInterval(this.metricsInterval);
this.fetchMetrics();
}
}

fetchMetrics(): void {
fetchMetrics = (): void => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using fat arrow to bind to this since we pass this.fetchMetrics directly to setTimeout below

if (!prometheusBasePath) {
// Component is not mounted or proxy has not been set up.
return;
Expand Down