diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-04 15:09:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-04 15:09:25 +0300 |
commit | f1500a385abba1f03c0eadc3c6a95ea532030b4c (patch) | |
tree | 75888a5073d3a09a9181c3b61987f2787a68ef92 /app/assets/javascripts/batch_comments | |
parent | 72241c5e0a5ced1416fcf69ed1a6d8f57b9bf3e2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/batch_comments')
-rw-r--r-- | app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js b/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js index 6ce5ebda241..bd7909bfa76 100644 --- a/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js +++ b/app/assets/javascripts/batch_comments/stores/modules/batch_comments/actions.js @@ -67,13 +67,23 @@ export const publishReview = ({ commit, dispatch, getters }) => { .catch(() => commit(types.RECEIVE_PUBLISH_REVIEW_ERROR)); }; -export const updateDiscussionsAfterPublish = ({ dispatch, getters, rootGetters }) => - dispatch('fetchDiscussions', { path: getters.getNotesData.discussionsPath }, { root: true }).then( - () => - dispatch('diffs/assignDiscussionsToDiff', rootGetters.discussionsStructuredByLineCode, { - root: true, - }), - ); +export const updateDiscussionsAfterPublish = async ({ dispatch, getters, rootGetters }) => { + if (window.gon?.features?.paginatedNotes) { + await dispatch('stopPolling', null, { root: true }); + await dispatch('fetchData', null, { root: true }); + await dispatch('restartPolling', null, { root: true }); + } else { + await dispatch( + 'fetchDiscussions', + { path: getters.getNotesData.discussionsPath }, + { root: true }, + ); + } + + dispatch('diffs/assignDiscussionsToDiff', rootGetters.discussionsStructuredByLineCode, { + root: true, + }); +}; export const updateDraft = ( { commit, getters }, |