fix small bug in IRMBanner rendering logic (#1749)

This commit is contained in:
Joey Orlando 2023-04-14 12:03:37 +02:00 committed by GitHub
parent bededd5544
commit 482809996f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View file

@ -15,9 +15,7 @@ const IRMBanner: React.FC = observer(() => {
} = store;
useEffect(() => {
if (store.isOpenSource()) {
alertGroupStore.fetchIRMPlan();
}
alertGroupStore.fetchIRMPlan();
}, []);
if (store.isOpenSource() || !irmPlan?.limits) {

View file

@ -208,7 +208,9 @@ export class AlertGroupStore extends BaseStore {
}
async fetchIRMPlan() {
this.irmPlan = await makeRequest(`/usage-limits`, { method: 'GET' });
if (!this.rootStore.isOpenSource()) {
this.irmPlan = await makeRequest(`/usage-limits`, { method: 'GET' });
}
}
// methods were moved from rootBaseStore.

View file

@ -99,11 +99,7 @@ class Incidents extends React.Component<IncidentsPageProps, IncidentsPageState>
private pollingIntervalId: NodeJS.Timer = undefined;
async componentDidMount() {
const { store } = this.props;
if (!store.isOpenSource()) {
await store.alertGroupStore.fetchIRMPlan();
}
await this.props.store.alertGroupStore.fetchIRMPlan();
}
componentWillUnmount(): void {