diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index 184866014048..1331e068fd61 100644 --- a/src/panels/profile/ha-panel-profile.ts +++ b/src/panels/profile/ha-panel-profile.ts @@ -37,6 +37,7 @@ import { haStyle } from "../../resources/styles"; import { HomeAssistant } from "../../types"; import { fireEvent } from "../../common/dom/fire_event"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; +import { showConfirmationDialog } from "../../dialogs/confirmation/show-dialog-confirmation"; class HaPanelProfile extends LitElement { @property() public hass!: HomeAssistant; @@ -173,7 +174,12 @@ class HaPanelProfile extends LitElement { } private _handleLogOut() { - fireEvent(this, "hass-logout"); + showConfirmationDialog(this, { + title: this.hass.localize("ui.panel.profile.logout_title"), + text: this.hass.localize("ui.panel.profile.logout_text"), + confirmBtnText: this.hass.localize("ui.panel.profile.logout"), + confirm: () => fireEvent(this, "hass-logout"), + }); } static get styles(): CSSResultArray { diff --git a/src/translations/en.json b/src/translations/en.json index c55df7c9d6cb..3b471ed9e4d6 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1834,6 +1834,8 @@ "current_user": "You are currently logged in as {fullName}.", "is_owner": "You are an owner.", "logout": "Log out", + "logout_title": "Log out?", + "logout_text": "Are you sure you want to log out?", "force_narrow": { "header": "Always hide the sidebar", "description": "This will hide the sidebar by default, similar to the mobile experience."