debian-mirror-gitlab/app/assets/javascripts/mr_notes/init_count.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
349 B
JavaScript
Raw Normal View History

2023-03-04 22:38:38 +05:30
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;
}
},
);
}