mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +00:00
Hide the tab when view is a subview (#25256)
This commit is contained in:
parent
9e5b7462af
commit
2b06742bb9
@ -300,6 +300,12 @@ class HUIRoot extends LitElement {
|
|||||||
|
|
||||||
const background = curViewConfig?.background || this.config.background;
|
const background = curViewConfig?.background || this.config.background;
|
||||||
|
|
||||||
|
const _isTabHiddenForUser = (view: LovelaceViewConfig) =>
|
||||||
|
view.visible !== undefined &&
|
||||||
|
((Array.isArray(view.visible) &&
|
||||||
|
!view.visible.some((e) => e.user === this.hass!.user?.id)) ||
|
||||||
|
view.visible === false);
|
||||||
|
|
||||||
const tabs = html`<sl-tab-group @sl-tab-show=${this._handleViewSelected}>
|
const tabs = html`<sl-tab-group @sl-tab-show=${this._handleViewSelected}>
|
||||||
${views.map(
|
${views.map(
|
||||||
(view, index) => html`
|
(view, index) => html`
|
||||||
@ -311,13 +317,7 @@ class HUIRoot extends LitElement {
|
|||||||
class=${classMap({
|
class=${classMap({
|
||||||
icon: Boolean(view.icon),
|
icon: Boolean(view.icon),
|
||||||
"hide-tab": Boolean(
|
"hide-tab": Boolean(
|
||||||
!this._editMode &&
|
!this._editMode && (view.subview || _isTabHiddenForUser(view))
|
||||||
view.visible !== undefined &&
|
|
||||||
((Array.isArray(view.visible) &&
|
|
||||||
!view.visible.some(
|
|
||||||
(e) => e.user === this.hass!.user?.id
|
|
||||||
)) ||
|
|
||||||
view.visible === false)
|
|
||||||
),
|
),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user