Refactor legacy JS (#33115)

This commit is contained in:
wxiaoguang 2025-01-06 17:38:42 +08:00 committed by GitHub
parent 40765b5d45
commit ef736b7e27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 31 additions and 29 deletions

View file

@ -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();
}