Commit 52b70f04 authored by Phil Hughes's avatar Phil Hughes

Fixed issue notes being duplicated

Closes #44099
parent f2723fc3
...@@ -197,7 +197,7 @@ const pollSuccessCallBack = (resp, commit, state, getters) => { ...@@ -197,7 +197,7 @@ const pollSuccessCallBack = (resp, commit, state, getters) => {
}); });
} }
commit(types.SET_LAST_FETCHED_AT, resp.lastFetchedAt); commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at);
return resp; return resp;
}; };
......
...@@ -90,15 +90,15 @@ export default { ...@@ -90,15 +90,15 @@ export default {
const notes = []; const notes = [];
notesData.forEach((note) => { notesData.forEach((note) => {
const nn = Object.assign({}, note);
// To support legacy notes, should be very rare case. // To support legacy notes, should be very rare case.
if (note.individual_note && note.notes.length > 1) { if (note.individual_note && note.notes.length > 1) {
note.notes.forEach((n) => { note.notes.forEach((n) => {
const nn = Object.assign({}, note);
nn.notes = [n]; // override notes array to only have one item to mimick individual_note nn.notes = [n]; // override notes array to only have one item to mimick individual_note
notes.push(nn); notes.push(nn);
}); });
} else { } else {
const nn = Object.assign({}, note);
const oldNote = utils.findNoteObjectById(state.notes, note.id); const oldNote = utils.findNoteObjectById(state.notes, note.id);
nn.expanded = oldNote ? oldNote.expanded : note.expanded; nn.expanded = oldNote ? oldNote.expanded : note.expanded;
......
...@@ -169,7 +169,7 @@ module NotesHelper ...@@ -169,7 +169,7 @@ module NotesHelper
reopenPath: reopen_issuable_path(issuable), reopenPath: reopen_issuable_path(issuable),
notesPath: notes_url, notesPath: notes_url,
totalNotes: issuable.discussions.length, totalNotes: issuable.discussions.length,
lastFetchedAt: Time.now lastFetchedAt: Time.now.to_i
}.to_json }.to_json
end end
......
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