diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-24 09:08:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-24 09:08:34 +0300 |
commit | 25bd06f7e75ab5510cb75f0971d210a8d0c93342 (patch) | |
tree | 575433e80d3fe7ae9625d71c172e46d7347a1f28 /app/assets/javascripts/mr_notes | |
parent | ba318c97cd1adf21ecedb6efaeb266c5c75d4505 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/mr_notes')
-rw-r--r-- | app/assets/javascripts/mr_notes/init.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/mr_notes/init.js b/app/assets/javascripts/mr_notes/init.js index aab3c41b4cf..79447bc115d 100644 --- a/app/assets/javascripts/mr_notes/init.js +++ b/app/assets/javascripts/mr_notes/init.js @@ -20,7 +20,6 @@ function setupMrNotesState(notesDataset) { store.dispatch('setUserData', currentUserData); store.dispatch('setTargetNoteHash', getLocationHash()); store.dispatch('setEndpoints', endpoints); - eventHub.$once('fetchNotesData', () => store.dispatch('fetchNotes')); } export function initMrStateLazyLoad() { @@ -35,10 +34,13 @@ export function initMrStateLazyLoad() { stop = store.watch( (state) => state.page.activeTab, (activeTab) => { + setupMrNotesState(notesDataset); + // prevent loading MR state on commits and pipelines pages // this is due to them having a shared controller with the Overview page if (['diffs', 'show'].includes(activeTab)) { - setupMrNotesState(notesDataset); + eventHub.$once('fetchNotesData', () => store.dispatch('fetchNotes')); + requestIdleCallback(() => { initReviewBar(); initOverviewTabCounter(); |