Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /app/assets/javascripts/commons/nav/user_merge_requests.js
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'app/assets/javascripts/commons/nav/user_merge_requests.js')
-rw-r--r--app/assets/javascripts/commons/nav/user_merge_requests.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/commons/nav/user_merge_requests.js b/app/assets/javascripts/commons/nav/user_merge_requests.js
index b105273ece7..90dca0310f3 100644
--- a/app/assets/javascripts/commons/nav/user_merge_requests.js
+++ b/app/assets/javascripts/commons/nav/user_merge_requests.js
@@ -30,6 +30,12 @@ function updateMergeRequestCounts(newCount) {
* Refresh user counts (and broadcast if open)
*/
export function refreshUserMergeRequestCounts() {
+ if (gon?.use_new_navigation) {
+ // The new sidebar manages _all_ the counts in
+ // ~/super_sidebar/user_counts_manager.js
+ document.dispatchEvent(new CustomEvent('userCounts:fetch'));
+ return Promise.resolve();
+ }
return getUserCounts()
.then(({ data }) => {
const assignedMergeRequests = data.assigned_merge_requests;
@@ -67,6 +73,12 @@ export function closeUserCountsBroadcast() {
* no special functionality lost except cross tab notifications
*/
export function openUserCountsBroadcast() {
+ if (gon?.use_new_navigation) {
+ // The new sidebar broadcasts _all counts_ and updates
+ // them accordingly. Therefore we do not need this manager
+ // ~/super_sidebar/user_counts_manager.js
+ return;
+ }
closeUserCountsBroadcast();
if (window.BroadcastChannel) {