Skip to content

Commit

Permalink
Reload application credentials after delete
Browse files Browse the repository at this point in the history
  • Loading branch information
silamon committed Jun 28, 2024
1 parent 4b7526c commit 76d5eaf
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class HaConfigApplicationCredentials extends LitElement {
path: mdiDelete,
warning: true,
label: this.hass.localize("ui.common.delete"),
action: () => this._removeCredential(credential),
action: () => this._deleteCredential(credential),
},
]}
>
Expand Down Expand Up @@ -132,7 +132,7 @@ export class HaConfigApplicationCredentials extends LitElement {
<div class="header-btns" slot="selection-bar">
${!this.narrow
? html`
<mwc-button @click=${this._removeSelected} class="warning"
<mwc-button @click=${this._deleteSelected} class="warning"
>${this.hass.localize(
"ui.panel.config.application_credentials.picker.remove_selected.button"
)}</mwc-button
Expand All @@ -142,7 +142,7 @@ export class HaConfigApplicationCredentials extends LitElement {
<ha-icon-button
class="warning"
id="remove-btn"
@click=${this._removeSelected}
@click=${this._deleteSelected}
.path=${mdiDelete}
.label=${this.hass.localize("ui.common.remove")}
></ha-icon-button>
Expand Down Expand Up @@ -174,7 +174,7 @@ export class HaConfigApplicationCredentials extends LitElement {
this._selected = ev.detail.value;
}

private _removeCredential = async (credential) => {
private _deleteCredential = async (credential) => {
const confirm = await showConfirmationDialog(this, {
title: this.hass.localize(
`ui.panel.config.application_credentials.picker.remove.confirm_title`
Expand All @@ -190,9 +190,10 @@ export class HaConfigApplicationCredentials extends LitElement {
return;
}
await deleteApplicationCredential(this.hass, credential.id);
await this._fetchApplicationCredentials();
};

private _removeSelected() {
private _deleteSelected() {
showConfirmationDialog(this, {
title: this.hass.localize(
`ui.panel.config.application_credentials.picker.remove_selected.confirm_title`,
Expand Down Expand Up @@ -224,7 +225,7 @@ export class HaConfigApplicationCredentials extends LitElement {
return;
}
this._dataTable.clearSelection();
this._fetchApplicationCredentials();
await this._fetchApplicationCredentials();
},
});
}
Expand Down

0 comments on commit 76d5eaf

Please sign in to comment.