Commit cee271ee authored by Tim Zallmann's avatar Tim Zallmann

Fix for displaying left side comments when no discussion available

parent f8214f95
......@@ -57,7 +57,9 @@ export default {
);
},
showRightSideCommentForm() {
return this.line.right.type && this.diffLineCommentForms[this.rightLineCode];
return (
this.line.right && this.line.right.type && this.diffLineCommentForms[this.rightLineCode]
);
},
className() {
return (this.left && this.line.left.discussions.length > 0) ||
......
......@@ -49,12 +49,14 @@ export const assignDiscussionsToDiff = ({ state }, allLineDiscussions) => {
}
}
const targetInlineLine = selectedFile.highlightedDiffLines.find(
line => line.lineCode === discussions[0].line_code,
);
if (selectedFile.highlightedDiffLines) {
const targetInlineLine = selectedFile.highlightedDiffLines.find(
line => line.lineCode === discussions[0].line_code,
);
if (targetInlineLine) {
Object.assign(targetInlineLine, { discussions });
if (targetInlineLine) {
Object.assign(targetInlineLine, { discussions });
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment