Merge "Fix bug where comments were not updated in reply dialog"
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -42,7 +42,7 @@ limitations under the License.
|
||||
word-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
<template is="dom-repeat" items="[[_files]]" as="file">
|
||||
<template is="dom-repeat" items="[[_computeFilesFromComments(comments)]]" as="file">
|
||||
<div class="file">
|
||||
<a href$="[[_computeFileDiffURL(file, changeNum, patchNum)]]">[[file]]</a>:
|
||||
</div>
|
||||
|
||||
@@ -21,14 +21,9 @@
|
||||
changeNum: Number,
|
||||
comments: Object,
|
||||
patchNum: Number,
|
||||
|
||||
_files: {
|
||||
type: Array,
|
||||
computed: '_computeFiles(comments)',
|
||||
},
|
||||
},
|
||||
|
||||
_computeFiles: function(comments) {
|
||||
_computeFilesFromComments: function(comments) {
|
||||
return Object.keys(comments || {}).sort();
|
||||
},
|
||||
|
||||
@@ -46,7 +41,9 @@
|
||||
},
|
||||
|
||||
_computeCommentsForFile: function(comments, file) {
|
||||
return comments[file];
|
||||
// Changes are not picked up by the dom-repeat due to the array instance
|
||||
// identity not changing even when it has elements added/removed from it.
|
||||
return (comments[file] || []).slice();
|
||||
},
|
||||
|
||||
_computePatchDisplayName: function(comment) {
|
||||
|
||||
Reference in New Issue
Block a user