Reload change when vote is deleted
Bug: Issue 7555 Change-Id: Ifd76847baa7a1042a090c46bb6762511ecbe172f
This commit is contained in:
@@ -127,27 +127,8 @@
|
|||||||
this.$.restAPI.deleteVote(this.change._number, accountID, this.label)
|
this.$.restAPI.deleteVote(this.change._number, accountID, this.label)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
target.disabled = false;
|
target.disabled = false;
|
||||||
if (!response.ok) { return response; }
|
if (!response.ok) { return; }
|
||||||
|
Gerrit.Nav.navigateToChange(this.change);
|
||||||
const label = this.change.labels[this.label];
|
|
||||||
const labels = label.all || [];
|
|
||||||
let wasChanged = false;
|
|
||||||
for (let i = 0; i < labels.length; i++) {
|
|
||||||
if (labels[i]._account_id === accountID) {
|
|
||||||
for (const key in label) {
|
|
||||||
if (label.hasOwnProperty(key) &&
|
|
||||||
label[key]._account_id === accountID) {
|
|
||||||
// Remove special label field, keeping change label values
|
|
||||||
// in sync with the backend.
|
|
||||||
this.change.labels[this.label][key] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.change.labels[this.label].all.splice(i, 1);
|
|
||||||
wasChanged = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (wasChanged) { this.notifySplices('change.labels'); }
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
target.disabled = false;
|
target.disabled = false;
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user