Merge "Fix broken file level comment"

This commit is contained in:
Ben Rohlfs
2020-09-15 17:43:17 +00:00
committed by Gerrit Code Review

View File

@@ -561,7 +561,13 @@ export class GrDiff extends GestureEventListeners(
);
return;
}
this._createComment(el, lineNum);
// TODO(TS): existing logic always pass undefined lineNum
// for file level comment, the drafts API will reject the
// request if file level draft contains the `line: 'FILE'` field
// probably should do this inside of the _createComment, this
// is just to keep existing behavior.
this._createComment(el, lineNum === FILE ? undefined : lineNum);
}
createRangeComment() {
@@ -644,7 +650,7 @@ export class GrDiff extends GestureEventListeners(
_createComment(
lineEl: Element,
lineNum: LineNumber,
lineNum?: LineNumber,
side?: Side,
range?: CommentRange
) {