File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import $ from 'jquery' ;
22import { GET } from '../modules/fetch.js' ;
3- import { elementsCall , toggleElem } from '../utils/dom.js' ;
3+ import { toggleElem } from '../utils/dom.js' ;
44
55const { appSubUrl, notificationSettings, assetVersionEncoded} = window . config ;
66let notificationSequenceNumber = 0 ;
@@ -179,7 +179,10 @@ async function updateNotificationCount() {
179179 const data = await response . json ( ) ;
180180
181181 toggleElem ( '.notification_count' , data . new !== 0 ) ;
182- elementsCall ( '.notification_count' , ( el ) => el . textContent = `${ data . new } ` ) ;
182+
183+ for ( const el of document . getElementsByClassName ( 'notification_count' ) ) {
184+ el . textContent = `${ data . new } ` ;
185+ }
183186
184187 return `${ data . new } ` ;
185188 } catch ( error ) {
Original file line number Diff line number Diff line change 11import { debounce } from 'throttle-debounce' ;
22
3- export function elementsCall ( el , func , ...args ) {
3+ function elementsCall ( el , func , ...args ) {
44 if ( typeof el === 'string' || el instanceof String ) {
55 el = document . querySelectorAll ( el ) ;
66 }
You can’t perform that action at this time.
0 commit comments