mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 04:31:21 -03:30
Merge pull request #8179 from nixocio/ui_fix_undefined_variable
Fix issue with undefined variable Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
dc492d0cfd
@ -15,7 +15,7 @@ function InstanceToggle({
|
||||
onToggle,
|
||||
i18n,
|
||||
}) {
|
||||
const { me } = useConfig();
|
||||
const { me = {} } = useConfig();
|
||||
const [isEnabled, setIsEnabled] = useState(instance.enabled);
|
||||
const [showError, setShowError] = useState(false);
|
||||
|
||||
@ -58,7 +58,7 @@ function InstanceToggle({
|
||||
label={i18n._(t`On`)}
|
||||
labelOff={i18n._(t`Off`)}
|
||||
isChecked={isEnabled}
|
||||
isDisabled={isLoading || !me.is_superuser}
|
||||
isDisabled={isLoading || !me?.is_superuser}
|
||||
onChange={toggleInstance}
|
||||
aria-label={i18n._(t`Toggle instance`)}
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user