Skip to content
Closed
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
1 change: 1 addition & 0 deletions hassio/src/addon-view/hassio-addon-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class HassioAddonConfig extends PolymerElement {
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/options"
data="[[resetData]]"
confirmation="Are you sure you want to reset the configuration?"
>Reset to defaults</ha-call-api-button
>
<mwc-button on-click="saveTapped" disabled="[[!configParsed]]"
Expand Down
4 changes: 4 additions & 0 deletions src/components/buttons/ha-call-api-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class HaCallApiButton extends LitElement {
method: String,
data: {},
disabled: Boolean,
confirmation: String,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a js file with Types in it? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it, unless I really screwed it up?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah you didn't

};
}

Expand All @@ -39,6 +40,9 @@ class HaCallApiButton extends LitElement {
}

async _buttonTapped() {
if (this.confirmation && !window.confirm(this.confirmation)) {
return;
}
this.progress = true;
const eventData = {
method: this.method,
Expand Down