summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaladox none <thomasmulhall410@yahoo.com>2018-11-14 01:07:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-11-14 01:07:58 +0000
commit688ab23c5098300da60af7501eb8509b400faf50 (patch)
tree20e161fdf43ae8d2fe0377a3e34ebf836e19eb81
parent13211dec1a55c3f3b4225d9cc2d9307be107392e (diff)
parent722007e96ce4e3169cbbb0dd81c21ded31d60266 (diff)
Merge "Reload change when vote is deleted" into stable-2.16
-rw-r--r--polygerrit-ui/app/elements/shared/gr-label-info/gr-label-info.js23
1 files changed, 2 insertions, 21 deletions
diff --git a/polygerrit-ui/app/elements/shared/gr-label-info/gr-label-info.js b/polygerrit-ui/app/elements/shared/gr-label-info/gr-label-info.js
index 2fe5f7b115..40edc28015 100644
--- a/polygerrit-ui/app/elements/shared/gr-label-info/gr-label-info.js
+++ b/polygerrit-ui/app/elements/shared/gr-label-info/gr-label-info.js
@@ -127,27 +127,8 @@
this.$.restAPI.deleteVote(this.change._number, accountID, this.label)
.then(response => {
target.disabled = false;
- if (!response.ok) { return response; }
-
- 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'); }
+ if (!response.ok) { return; }
+ Gerrit.Nav.navigateToChange(this.change);
}).catch(err => {
target.disabled = false;
return;