mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Don't display keyboard shortcut hints if keyboard shortcuts are disabled (#20456)
* Shortcut hints * Prettier
This commit is contained in:
parent
e8a140af44
commit
1e0f7d9629
@ -93,10 +93,19 @@ const randomTip = (hass: HomeAssistant, narrow: boolean) => {
|
|||||||
weight: 2,
|
weight: 2,
|
||||||
narrow: true,
|
narrow: true,
|
||||||
},
|
},
|
||||||
{ content: hass.localize("ui.tips.key_c_hint"), weight: 1, narrow: false },
|
|
||||||
{ content: hass.localize("ui.tips.key_m_hint"), weight: 1, narrow: false },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (hass?.enableShortcuts) {
|
||||||
|
tips.push(
|
||||||
|
{
|
||||||
|
content: hass.localize("ui.tips.key_c_hint"),
|
||||||
|
weight: 1,
|
||||||
|
narrow: false,
|
||||||
|
},
|
||||||
|
{ content: hass.localize("ui.tips.key_m_hint"), weight: 1, narrow: false }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (narrow) {
|
if (narrow) {
|
||||||
tips = tips.filter((tip) => tip.narrow);
|
tips = tips.filter((tip) => tip.narrow);
|
||||||
}
|
}
|
||||||
@ -310,7 +319,9 @@ class HaConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
private _showQuickBar(): void {
|
private _showQuickBar(): void {
|
||||||
showQuickBar(this, {
|
showQuickBar(this, {
|
||||||
commandMode: true,
|
commandMode: true,
|
||||||
hint: this.hass.localize("ui.dialogs.quick-bar.key_c_hint"),
|
hint: this.hass.enableShortcuts
|
||||||
|
? this.hass.localize("ui.dialogs.quick-bar.key_c_hint")
|
||||||
|
: undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,9 +128,11 @@ class HaPanelDevState extends LitElement {
|
|||||||
allow-custom-entity
|
allow-custom-entity
|
||||||
item-label-path="entity_id"
|
item-label-path="entity_id"
|
||||||
></ha-entity-picker>
|
></ha-entity-picker>
|
||||||
<ha-tip .hass=${this.hass}
|
${this.hass.enableShortcuts
|
||||||
|
? html`<ha-tip .hass=${this.hass}
|
||||||
>${this.hass.localize("ui.tips.key_e_hint")}</ha-tip
|
>${this.hass.localize("ui.tips.key_e_hint")}</ha-tip
|
||||||
>
|
>`
|
||||||
|
: nothing}
|
||||||
<ha-textfield
|
<ha-textfield
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.developer-tools.tabs.states.state"
|
"ui.panel.developer-tools.tabs.states.state"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user