mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Fix issue with undefined variable
Fix issue with undefined variable when data related to `me` is not available.
This commit is contained in:
parent
56c5a39087
commit
9d0b37e96c
@ -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