diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-07-17 18:47:02 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-07-17 18:47:02 +0300 |
commit | 422dcfde03b94bd70bfc657930310069a764a4d9 (patch) | |
tree | 7ef451cf1c096f8e0e8629d4206942d33fc7f87f /app/assets/javascripts/diffs/components/diff_line_note_form.vue | |
parent | 98547133dbea5ca758edc4b4e92c018210257c57 (diff) |
Resolve "MR: Reduce the memory footprint of the component tree"
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_line_note_form.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_line_note_form.vue | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index db380e68bd1..32f9516d332 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -13,12 +13,8 @@ export default { noteForm, }, props: { - diffFile: { - type: Object, - required: true, - }, - diffLines: { - type: Array, + diffFileHash: { + type: String, required: true, }, line: { @@ -40,6 +36,7 @@ export default { noteableData: state => state.notes.noteableData, diffViewType: state => state.diffs.diffViewType, }), + ...mapGetters('diffs', ['getDiffFileByHash']), ...mapGetters(['isLoggedIn', 'noteableType', 'getNoteableData', 'getNotesDataByProp']), }, mounted() { @@ -68,13 +65,14 @@ export default { }); }, handleSaveNote(note) { + const selectedDiffFile = this.getDiffFileByHash(this.diffFileHash); const postData = getNoteFormData({ note, noteableData: this.noteableData, noteableType: this.noteableType, noteTargetLine: this.noteTargetLine, diffViewType: this.diffViewType, - diffFile: this.diffFile, + diffFile: selectedDiffFile, linePosition: this.position, }); |