Refactor legacy JS (#33115)
This commit is contained in:
parent
40765b5d45
commit
ef736b7e27
5 changed files with 31 additions and 29 deletions
|
@ -1,6 +1,5 @@
|
|||
import $ from 'jquery';
|
||||
import {GET} from '../modules/fetch.ts';
|
||||
import {toggleElem, type DOMEvent} from '../utils/dom.ts';
|
||||
import {toggleElem, type DOMEvent, createElementFromHTML} from '../utils/dom.ts';
|
||||
import {logoutFromWorker} from '../modules/worker.ts';
|
||||
|
||||
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
|
||||
|
@ -158,7 +157,8 @@ async function updateNotificationTable() {
|
|||
}
|
||||
|
||||
const data = await response.text();
|
||||
if ($(data).data('sequence-number') === notificationSequenceNumber) {
|
||||
const el = createElementFromHTML(data);
|
||||
if (parseInt(el.getAttribute('data-sequence-number')) === notificationSequenceNumber) {
|
||||
notificationDiv.outerHTML = data;
|
||||
initNotificationsTable();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue