mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 18:39:40 +00:00
Add a force mobile mode on desktop (#3394)
* Add a force mobile mode * Fix columns on LL * Update text * Move it above the push notifications * Hide notification count when sidebar expanded and count=0
This commit is contained in:
@@ -78,14 +78,25 @@ class HaMenuButton extends LitElement {
|
||||
protected updated(changedProps) {
|
||||
super.updated(changedProps);
|
||||
|
||||
if (!changedProps.has("narrow")) {
|
||||
if (!changedProps.has("narrow") && !changedProps.has("hass")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
||||
const oldNarrow =
|
||||
changedProps.get("narrow") ||
|
||||
(oldHass && oldHass.dockedSidebar === "always_hidden");
|
||||
const newNarrow =
|
||||
this.narrow || this.hass.dockedSidebar === "always_hidden";
|
||||
|
||||
if (oldNarrow === newNarrow) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.style.visibility =
|
||||
this.narrow || this._alwaysVisible ? "initial" : "hidden";
|
||||
newNarrow || this._alwaysVisible ? "initial" : "hidden";
|
||||
|
||||
if (!this.narrow) {
|
||||
if (!newNarrow) {
|
||||
this._hasNotifications = false;
|
||||
if (this._unsubNotifications) {
|
||||
this._unsubNotifications();
|
||||
|
||||
Reference in New Issue
Block a user