Fixed issue notes being duplicated

Closes #44099
This commit is contained in:
Phil Hughes 2018-03-09 18:22:23 +00:00
parent f2723fc3e9
commit 52b70f0428
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
3 changed files with 4 additions and 4 deletions

View file

@ -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;
};

View file

@ -90,15 +90,15 @@ export default {
const notes = [];
notesData.forEach((note) => {
const nn = Object.assign({}, note);
// 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);
});
} else {
const nn = Object.assign({}, note);
const oldNote = utils.findNoteObjectById(state.notes, note.id);
nn.expanded = oldNote ? oldNote.expanded : note.expanded;

View file

@ -169,7 +169,7 @@ module NotesHelper
reopenPath: reopen_issuable_path(issuable),
notesPath: notes_url,
totalNotes: issuable.discussions.length,
lastFetchedAt: Time.now
lastFetchedAt: Time.now.to_i
}.to_json
end