Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await copy clipboard #23438

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/panels/config/backup/dialogs/dialog-backup-onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
});
Expand Down
4 changes: 2 additions & 2 deletions src/panels/developer-tools/state/developer-tools-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading