mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fix menu button when sidebar is always_hidden (#17059)
This commit is contained in:
parent
927c6dd778
commit
ce9380e4d7
@ -73,25 +73,25 @@ class HaMenuButton extends LitElement {
|
||||
return;
|
||||
}
|
||||
|
||||
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
||||
const oldHass = changedProps.has("hass")
|
||||
? (changedProps.get("hass") as HomeAssistant | undefined)
|
||||
: this.hass;
|
||||
const oldNarrow = changedProps.has("narrow")
|
||||
? (changedProps.get("narrow") as boolean | undefined)
|
||||
: this.narrow;
|
||||
|
||||
let oldNarrow: boolean | undefined;
|
||||
let newNarrow: boolean | undefined;
|
||||
if (changedProps.has("narrow")) {
|
||||
oldNarrow = changedProps.get("narrow");
|
||||
newNarrow = this.narrow;
|
||||
} else if (oldHass) {
|
||||
oldNarrow = oldHass.dockedSidebar === "always_hidden";
|
||||
newNarrow = this.hass.dockedSidebar === "always_hidden";
|
||||
}
|
||||
const oldShowButton =
|
||||
oldNarrow || oldHass?.dockedSidebar === "always_hidden";
|
||||
const showButton =
|
||||
this.narrow || this.hass.dockedSidebar === "always_hidden";
|
||||
|
||||
if (oldNarrow === newNarrow) {
|
||||
if (oldShowButton === showButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.style.display = newNarrow || this._alwaysVisible ? "initial" : "none";
|
||||
this.style.display = showButton || this._alwaysVisible ? "initial" : "none";
|
||||
|
||||
if (!newNarrow) {
|
||||
if (!showButton) {
|
||||
if (this._unsubNotifications) {
|
||||
this._unsubNotifications();
|
||||
this._unsubNotifications = undefined;
|
||||
|
Loading…
x
Reference in New Issue
Block a user