mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
🚸 prompt user to confirm logout (#4501)
* 🚸 prompt user to confirm logout * 👌 update dialog title/text/confirm
This commit is contained in:
parent
28511d0cbf
commit
1a2ebabd22
@ -37,6 +37,7 @@ import { haStyle } from "../../resources/styles";
|
|||||||
import { HomeAssistant } from "../../types";
|
import { HomeAssistant } from "../../types";
|
||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
|
import { showConfirmationDialog } from "../../dialogs/confirmation/show-dialog-confirmation";
|
||||||
|
|
||||||
class HaPanelProfile extends LitElement {
|
class HaPanelProfile extends LitElement {
|
||||||
@property() public hass!: HomeAssistant;
|
@property() public hass!: HomeAssistant;
|
||||||
@ -173,7 +174,12 @@ class HaPanelProfile extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _handleLogOut() {
|
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 {
|
static get styles(): CSSResultArray {
|
||||||
|
@ -1848,6 +1848,8 @@
|
|||||||
"current_user": "You are currently logged in as {fullName}.",
|
"current_user": "You are currently logged in as {fullName}.",
|
||||||
"is_owner": "You are an owner.",
|
"is_owner": "You are an owner.",
|
||||||
"logout": "Log out",
|
"logout": "Log out",
|
||||||
|
"logout_title": "Log out?",
|
||||||
|
"logout_text": "Are you sure you want to log out?",
|
||||||
"force_narrow": {
|
"force_narrow": {
|
||||||
"header": "Always hide the sidebar",
|
"header": "Always hide the sidebar",
|
||||||
"description": "This will hide the sidebar by default, similar to the mobile experience."
|
"description": "This will hide the sidebar by default, similar to the mobile experience."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user