Commit 101a7f37 authored by Phil Hughes's avatar Phil Hughes

Fixed batch comments specs

parent aeec5fa3
...@@ -108,7 +108,6 @@ export default { ...@@ -108,7 +108,6 @@ export default {
async isFetching() { async isFetching() {
if (!this.isFetching) { if (!this.isFetching) {
await this.$nextTick(); await this.$nextTick();
await this.updateResolvableDiscussionsCounts();
await this.startTaskList(); await this.startTaskList();
await this.checkLocationHash(); await this.checkLocationHash();
} }
...@@ -180,7 +179,6 @@ export default { ...@@ -180,7 +179,6 @@ export default {
'convertToDiscussion', 'convertToDiscussion',
'stopPolling', 'stopPolling',
'setConfidentiality', 'setConfidentiality',
'updateResolvableDiscussionsCounts',
]), ]),
discussionIsIndividualNoteAndNotConverted(discussion) { discussionIsIndividualNoteAndNotConverted(discussion) {
return discussion.individual_note && !this.convertedDisscussionIds.includes(discussion.id); return discussion.individual_note && !this.convertedDisscussionIds.includes(discussion.id);
......
...@@ -424,7 +424,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => { ...@@ -424,7 +424,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
export const setFetchingState = ({ commit }, fetchingState) => export const setFetchingState = ({ commit }, fetchingState) =>
commit(types.SET_NOTES_FETCHING_STATE, fetchingState); commit(types.SET_NOTES_FETCHING_STATE, fetchingState);
const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => { const pollSuccessCallBack = async (resp, commit, state, getters, dispatch) => {
if (state.isResolvingDiscussion) { if (state.isResolvingDiscussion) {
return null; return null;
} }
...@@ -437,8 +437,9 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => { ...@@ -437,8 +437,9 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => {
} }
if (resp.notes?.length) { if (resp.notes?.length) {
dispatch('updateOrCreateNotes', resp.notes); await dispatch('updateOrCreateNotes', resp.notes);
dispatch('startTaskList'); dispatch('startTaskList');
dispatch('updateResolvableDiscussionsCounts');
} }
commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at); commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at);
...@@ -449,6 +450,7 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => { ...@@ -449,6 +450,7 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => {
const getFetchDataParams = (state) => { const getFetchDataParams = (state) => {
const endpoint = state.notesData.notesPath; const endpoint = state.notesData.notesPath;
const options = { const options = {
params: { t: new Date().getTime() },
headers: { headers: {
'X-Last-Fetched-At': state.lastFetchedAt ? `${state.lastFetchedAt}` : undefined, 'X-Last-Fetched-At': state.lastFetchedAt ? `${state.lastFetchedAt}` : undefined,
}, },
......
...@@ -32,6 +32,23 @@ export default { ...@@ -32,6 +32,23 @@ export default {
} }
} }
if (
window.gon?.features?.paginatedNotes &&
note.base_discussion &&
type === constants.DIFF_NOTE
) {
if (discussion.diff_file) {
discussion.file_hash = discussion.diff_file.file_hash;
discussion.truncated_diff_lines = utils.prepareDiffLines(
discussion.truncated_diff_lines || [],
);
}
discussion.expanded = note.expanded;
discussion.resolved = note.resolved;
}
// note.base_discussion = undefined; // No point keeping a reference to this // note.base_discussion = undefined; // No point keeping a reference to this
delete note.base_discussion; delete note.base_discussion;
discussion.notes = [note]; discussion.notes = [note];
......
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