Ensure reply dialog comments are properly sorted

When making inline comments, they were appended, which means they
would appear in the order that they were added. Ensure proper
sorting based on the line number (or -1 if it’s a file comment).

Change-Id: Ic1ba951184a468d78b09581831e2b4623fbfb7e2
This commit is contained in:
Andrew Bonventre
2016-06-09 16:32:32 -04:00
parent 21bfc53e6c
commit 270e105f88

View File

@@ -217,6 +217,11 @@
}
}
diffDrafts[draft.path].push(draft);
diffDrafts[draft.path].sort(function(c1, c2) {
// No line number means that its a file comment. Sort it above the
// others.
return (c1.line || -1) - (c2.line || -1);
});
this._diffDrafts = diffDrafts;
},