diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index 1848660140..1331e068fd 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 448baa3b93..5680b7d5ad 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1848,6 +1848,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."