mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +00:00
await copy clipboard (#23438)
This commit is contained in:
parent
637fe37ef4
commit
fc8a8b28c2
@ -395,8 +395,8 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
|
|||||||
downloadEmergencyKit(this.hass, key);
|
downloadEmergencyKit(this.hass, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _copyKeyToClipboard() {
|
private async _copyKeyToClipboard() {
|
||||||
copyToClipboard(this._config!.create_backup.password!);
|
await copyToClipboard(this._config!.create_backup.password!);
|
||||||
showToast(this, {
|
showToast(this, {
|
||||||
message: this.hass.localize("ui.common.copied_clipboard"),
|
message: this.hass.localize("ui.common.copied_clipboard"),
|
||||||
});
|
});
|
||||||
|
@ -205,18 +205,18 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
|
|||||||
return nothing;
|
return nothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _copyKeyToClipboard() {
|
private async _copyKeyToClipboard() {
|
||||||
copyToClipboard(this._newEncryptionKey);
|
await copyToClipboard(this._newEncryptionKey);
|
||||||
showToast(this, {
|
showToast(this, {
|
||||||
message: this.hass.localize("ui.common.copied_clipboard"),
|
message: this.hass.localize("ui.common.copied_clipboard"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _copyOldKeyToClipboard() {
|
private async _copyOldKeyToClipboard() {
|
||||||
if (!this._params?.currentKey) {
|
if (!this._params?.currentKey) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
copyToClipboard(this._params.currentKey);
|
await copyToClipboard(this._params.currentKey);
|
||||||
showToast(this, {
|
showToast(this, {
|
||||||
message: this.hass.localize("ui.common.copied_clipboard"),
|
message: this.hass.localize("ui.common.copied_clipboard"),
|
||||||
});
|
});
|
||||||
|
@ -324,10 +324,10 @@ class HaPanelDevState extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _copyEntity(ev) {
|
private async _copyEntity(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
const entity = (ev.currentTarget! as any).entity;
|
const entity = (ev.currentTarget! as any).entity;
|
||||||
copyToClipboard(entity.entity_id);
|
await copyToClipboard(entity.entity_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _entitySelected(ev) {
|
private _entitySelected(ev) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user