await copy clipboard (#23438)

This commit is contained in:
Bram Kragten 2024-12-24 15:15:17 +01:00 committed by GitHub
parent 637fe37ef4
commit fc8a8b28c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -395,8 +395,8 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
downloadEmergencyKit(this.hass, key);
}
private _copyKeyToClipboard() {
copyToClipboard(this._config!.create_backup.password!);
private async _copyKeyToClipboard() {
await copyToClipboard(this._config!.create_backup.password!);
showToast(this, {
message: this.hass.localize("ui.common.copied_clipboard"),
});

View File

@ -205,18 +205,18 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
return nothing;
}
private _copyKeyToClipboard() {
copyToClipboard(this._newEncryptionKey);
private async _copyKeyToClipboard() {
await copyToClipboard(this._newEncryptionKey);
showToast(this, {
message: this.hass.localize("ui.common.copied_clipboard"),
});
}
private _copyOldKeyToClipboard() {
private async _copyOldKeyToClipboard() {
if (!this._params?.currentKey) {
return;
}
copyToClipboard(this._params.currentKey);
await copyToClipboard(this._params.currentKey);
showToast(this, {
message: this.hass.localize("ui.common.copied_clipboard"),
});

View File

@ -324,10 +324,10 @@ class HaPanelDevState extends LitElement {
`;
}
private _copyEntity(ev) {
private async _copyEntity(ev) {
ev.preventDefault();
const entity = (ev.currentTarget! as any).entity;
copyToClipboard(entity.entity_id);
await copyToClipboard(entity.entity_id);
}
private _entitySelected(ev) {