fix small bug in IRMBanner rendering logic (#1749)
This commit is contained in:
parent
bededd5544
commit
482809996f
3 changed files with 5 additions and 9 deletions
|
|
@ -15,9 +15,7 @@ const IRMBanner: React.FC = observer(() => {
|
|||
} = store;
|
||||
|
||||
useEffect(() => {
|
||||
if (store.isOpenSource()) {
|
||||
alertGroupStore.fetchIRMPlan();
|
||||
}
|
||||
alertGroupStore.fetchIRMPlan();
|
||||
}, []);
|
||||
|
||||
if (store.isOpenSource() || !irmPlan?.limits) {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue