Only load realms once and not on focus (#4015)
This commit is contained in:
parent
c9c8fe7317
commit
1155371439
1 changed files with 4 additions and 2 deletions
|
@ -163,13 +163,15 @@ export const RealmSelector = () => {
|
||||||
toggle={
|
toggle={
|
||||||
<DropdownToggle
|
<DropdownToggle
|
||||||
data-testid="realmSelectorToggle"
|
data-testid="realmSelectorToggle"
|
||||||
onToggle={() => setOpen(!open)}
|
onToggle={() => {
|
||||||
|
if (realms.length === 0) refresh();
|
||||||
|
setOpen(!open);
|
||||||
|
}}
|
||||||
className="keycloak__realm_selector_dropdown__toggle"
|
className="keycloak__realm_selector_dropdown__toggle"
|
||||||
>
|
>
|
||||||
{realm}
|
{realm}
|
||||||
</DropdownToggle>
|
</DropdownToggle>
|
||||||
}
|
}
|
||||||
onFocus={refresh}
|
|
||||||
dropdownItems={[...dropdownItems, addRealmComponent]}
|
dropdownItems={[...dropdownItems, addRealmComponent]}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in a new issue