1
0
Fork 0
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:
Luke Pulverenti 2015-05-19 15:15:40 -04:00
parent 463ad6cfb1
commit bbdbdf346e
92 changed files with 1062 additions and 518 deletions

View file

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