diff --git a/public/app/core/components/Select/OrgPicker.tsx b/public/app/core/components/Select/OrgPicker.tsx index e5a0433c754..77299295d62 100644 --- a/public/app/core/components/Select/OrgPicker.tsx +++ b/public/app/core/components/Select/OrgPicker.tsx @@ -36,7 +36,7 @@ export class OrgPicker extends PureComponent { } getOrgOptions = async (query: string): Promise>> => { - if (!this.orgs) { + if (!this.orgs?.length) { await this.loadOrgs(); } return this.orgs.map( diff --git a/public/app/features/admin/UserOrgs.tsx b/public/app/features/admin/UserOrgs.tsx index 85232d0ee54..083650ace92 100644 --- a/public/app/features/admin/UserOrgs.tsx +++ b/public/app/features/admin/UserOrgs.tsx @@ -1,16 +1,6 @@ import React, { PureComponent } from 'react'; import { css, cx } from '@emotion/css'; -import { - Button, - ConfirmButton, - Container, - Field, - HorizontalGroup, - Modal, - stylesFactory, - Themeable, - withTheme, -} from '@grafana/ui'; +import { Button, ConfirmButton, Field, HorizontalGroup, Modal, stylesFactory, Themeable, withTheme } from '@grafana/ui'; import { GrafanaTheme } from '@grafana/data'; import { AccessControlAction, Organization, OrgRole, UserOrg } from 'app/types'; import { OrgPicker, OrgSelectItem } from 'app/core/components/Select/OrgPicker'; @@ -251,16 +241,16 @@ export class AddToOrgModal extends PureComponent - + + - - + ); }