We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef8ffcf commit 9f83631Copy full SHA for 9f83631
web_src/js/features/notification.js
@@ -1,6 +1,6 @@
1
import $ from 'jquery';
2
import {GET} from '../modules/fetch.js';
3
-import {hideElem, showElem} from '../utils/dom.js';
+import {toggleElem} from '../utils/dom.js';
4
5
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
6
let notificationSequenceNumber = 0;
@@ -178,11 +178,7 @@ async function updateNotificationCount() {
178
179
const data = await response.json();
180
181
- if (data.new === 0) {
182
- hideElem('.notification_count');
183
- } else {
184
- showElem('.notification_count');
185
- }
+ toggleElem('.notification_count', data.new !== 0);
186
187
for (const el of document.getElementsByClassName('notification_count')) {
188
el.textContent = `${data.new}`;
0 commit comments