mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update script loading
This commit is contained in:
parent
463ad6cfb1
commit
bbdbdf346e
92 changed files with 1062 additions and 518 deletions
|
@ -226,23 +226,28 @@
|
|||
}
|
||||
});
|
||||
|
||||
function initializeApiClient(apiClient) {
|
||||
$(apiClient).on("websocketmessage", function (e, msg) {
|
||||
function onWebSocketMessage(e, msg) {
|
||||
if (msg.MessageType === "NotificationUpdated" || msg.MessageType === "NotificationAdded" || msg.MessageType === "NotificationsMarkedRead") {
|
||||
|
||||
Notifications.getNotificationsSummaryPromise = null;
|
||||
|
||||
if (msg.MessageType === "NotificationUpdated" || msg.MessageType === "NotificationAdded" || msg.MessageType === "NotificationsMarkedRead") {
|
||||
|
||||
Notifications.getNotificationsSummaryPromise = null;
|
||||
|
||||
Notifications.updateNotificationCount();
|
||||
}
|
||||
|
||||
});
|
||||
Notifications.updateNotificationCount();
|
||||
}
|
||||
}
|
||||
|
||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
||||
function initializeApiClient(apiClient) {
|
||||
$(apiClient).off("websocketmessage", onWebSocketMessage).on("websocketmessage", onWebSocketMessage);
|
||||
}
|
||||
|
||||
initializeApiClient(apiClient);
|
||||
Dashboard.ready(function () {
|
||||
|
||||
if (window.ApiClient) {
|
||||
initializeApiClient(window.ApiClient);
|
||||
}
|
||||
|
||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
||||
initializeApiClient(apiClient);
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery, document, Dashboard, LibraryBrowser);
|
Loading…
Add table
Add a link
Reference in a new issue