From 552c474febf0122baef7caf9648d4c6da8b87ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 4 May 2022 15:17:09 +0200 Subject: [PATCH] Fix setting _externalAccess (#12584) --- .../config/core/ha-config-system-navigation.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/panels/config/core/ha-config-system-navigation.ts b/src/panels/config/core/ha-config-system-navigation.ts index 82087c1a07..a3335d5903 100644 --- a/src/panels/config/core/ha-config-system-navigation.ts +++ b/src/panels/config/core/ha-config-system-navigation.ts @@ -218,14 +218,13 @@ class HaConfigSystemNavigation extends LitElement { private async _fetchNetworkStatus() { if (isComponentLoaded(this.hass, "cloud")) { - fetchCloudStatus(this.hass).then((cloudStatus) => { - if (cloudStatus.logged_in) { - this._externalAccess = true; - } - }); - } else { - this._externalAccess = this.hass.config.external_url !== null; + const cloudStatus = await fetchCloudStatus(this.hass); + if (cloudStatus.logged_in) { + this._externalAccess = true; + return; + } } + this._externalAccess = this.hass.config.external_url !== null; } static get styles(): CSSResultGroup {