summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/stores
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-03-10 18:17:01 +0000
committerPhil Hughes <me@iamphill.com>2018-03-10 18:17:01 +0000
commit98e31bf437c9934884bd8a7b5c311617757d0785 (patch)
tree2591fc876f0e76f8fd1289ee4821b76643dfa122 /app/assets/javascripts/notes/stores
parent87be05bff037bf72e4496b2d3e266d0ba554d2c1 (diff)
downloadgitlab-ce-98e31bf437c9934884bd8a7b5c311617757d0785.tar.gz
added mutation spec
Diffstat (limited to 'app/assets/javascripts/notes/stores')
-rw-r--r--app/assets/javascripts/notes/stores/mutations.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes/stores/mutations.js b/app/assets/javascripts/notes/stores/mutations.js
index aed0a44e808..949628a65c0 100644
--- a/app/assets/javascripts/notes/stores/mutations.js
+++ b/app/assets/javascripts/notes/stores/mutations.js
@@ -93,16 +93,18 @@ export default {
// To support legacy notes, should be very rare case.
if (note.individual_note && note.notes.length > 1) {
note.notes.forEach((n) => {
- const nn = Object.assign({}, note);
- nn.notes = [n]; // override notes array to only have one item to mimick individual_note
- notes.push(nn);
+ notes.push({
+ ...note,
+ notes: [n], // override notes array to only have one item to mimick individual_note
+ });
});
} else {
- const nn = Object.assign({}, note);
const oldNote = utils.findNoteObjectById(state.notes, note.id);
- nn.expanded = oldNote ? oldNote.expanded : note.expanded;
- notes.push(nn);
+ notes.push({
+ ...note,
+ expanded: (oldNote ? oldNote.expanded : note.expanded),
+ });
}
});