debian-mirror-gitlab/app/assets/javascripts/mr_notes/init_count.js
2023-03-04 22:38:38 +05:30

13 lines
349 B
JavaScript

import store from '~/mr_notes/stores';
export function initOverviewTabCounter() {
const discussionsCount = document.querySelector('.js-discussions-count');
store.watch(
(state, getters) => getters.discussionTabCounter,
(val) => {
if (typeof val !== 'undefined') {
discussionsCount.textContent = val;
}
},
);
}