diff --git a/src/panels/config/backup/dialogs/dialog-backup-onboarding.ts b/src/panels/config/backup/dialogs/dialog-backup-onboarding.ts index 2a8ff15bf4c4..d12081c1562d 100644 --- a/src/panels/config/backup/dialogs/dialog-backup-onboarding.ts +++ b/src/panels/config/backup/dialogs/dialog-backup-onboarding.ts @@ -404,8 +404,8 @@ class DialogBackupOnboarding extends LitElement implements HassDialog { ); } - 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"), }); diff --git a/src/panels/config/backup/dialogs/dialog-change-backup-encryption-key.ts b/src/panels/config/backup/dialogs/dialog-change-backup-encryption-key.ts index 1020083e3a73..5f7556eb3adf 100644 --- a/src/panels/config/backup/dialogs/dialog-change-backup-encryption-key.ts +++ b/src/panels/config/backup/dialogs/dialog-change-backup-encryption-key.ts @@ -203,18 +203,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"), }); diff --git a/src/panels/developer-tools/state/developer-tools-state.ts b/src/panels/developer-tools/state/developer-tools-state.ts index a6ec61a221f8..d9204e0bdf06 100644 --- a/src/panels/developer-tools/state/developer-tools-state.ts +++ b/src/panels/developer-tools/state/developer-tools-state.ts @@ -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) {