Commit 75b18e04 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[DlcSettingsUi] Fix 'Remove' button disabled when it should not be.

Fixed: 1096770
Change-Id: I60f55f43534f3388801c1a5aca29f936861d7398
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2253128Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785815}
parent 3b7b85c2
......@@ -64,8 +64,8 @@
</div>
</div>
<cr-button
data-dlc-id$="[[item.id]]"
id="remove-button-[[index]]"
disabled="[[item.disabled]]"
data-index$="[[index]]"
on-click="onRemoveDlcClick_"
tabindex$="[[tabIndex]]"
aria-describedby$="name[[index]] size[[index]]
......
......@@ -46,18 +46,9 @@ cr.define('settings', function() {
* @private
*/
onRemoveDlcClick_(e) {
const removeButton = this.shadowRoot.querySelector(`#${e.target.id}`);
removeButton.disabled = true;
this.browserProxy_.purgeDlc(e.target.getAttribute('data-dlc-id'))
.then(success => {
if (success) {
// No further action is necessary since the list will change via
// onDlcListChanged_().
return;
}
console.log(`Unable to purge DLC with ID ${e.target.id}`);
removeButton.disabled = false;
});
const item = this.$.list.items[e.target.dataset.index];
item.disabled = true;
this.browserProxy_.purgeDlc(item.id);
},
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment