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,
|
||||
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) {
|
||||
tips = tips.filter((tip) => tip.narrow);
|
||||
}
|
||||
|
@ -310,7 +319,9 @@ class HaConfigDashboard extends SubscribeMixin(LitElement) {
|
|||
private _showQuickBar(): void {
|
||||
showQuickBar(this, {
|
||||
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
|
||||
item-label-path="entity_id"
|
||||
></ha-entity-picker>
|
||||
<ha-tip .hass=${this.hass}
|
||||
>${this.hass.localize("ui.tips.key_e_hint")}</ha-tip
|
||||
>
|
||||
${this.hass.enableShortcuts
|
||||
? html`<ha-tip .hass=${this.hass}
|
||||
>${this.hass.localize("ui.tips.key_e_hint")}</ha-tip
|
||||
>`
|
||||
: nothing}
|
||||
<ha-textfield
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.states.state"
|
||||
|
|
Loading…
Reference in New Issue