Fix bug where comments were not updated in reply dialog
So this has to do with the way Polymer does dirty checking
from within dom-repeat. Since the underlying array instance
identity was not changed, the dom-repeat would not trigger
and the reply dialog was not updated properly.
Additionally:
+ Guard against searching for a saved draft when discarding
one that hasn’t been saved.
+ Move _files to be a compute function.
Change-Id: Idc49f158cba7f908d50f163a6fdbd93fbe585462
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
index 831fdb8..d6f4cec 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
@@ -169,7 +169,9 @@
}
}
if (index === -1) {
- throw Error('Unable to find draft with id ' + draft.id);
+ // It may be a draft that hasn’t been added to _diffDrafts since it was
+ // never saved.
+ return;
}
draft.patch_set = draft.patch_set || this._patchRange.patchNum;