1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix windows restart

This commit is contained in:
Luke Pulverenti 2015-09-21 21:05:33 -04:00
parent 4ef47844d8
commit 257a7d2879
18 changed files with 221 additions and 141 deletions

View file

@ -27,6 +27,10 @@
return;
}
if (!window.ApiClient) {
return;
}
var promise = self.getNotificationsSummary();
if (!promise) {
@ -168,13 +172,7 @@
}
window.Notifications = new notifications();
$(document).on('libraryMenuCreated', function (e) {
if (window.ApiClient) {
Notifications.updateNotificationCount();
}
});
var needsRefresh = true;
function onWebSocketMessage(e, msg) {
if (msg.MessageType === "NotificationUpdated" || msg.MessageType === "NotificationAdded" || msg.MessageType === "NotificationsMarkedRead") {
@ -198,6 +196,24 @@
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
initializeApiClient(apiClient);
});
Events.on(ConnectionManager, 'localusersignedin', function () {
needsRefresh = true;
});
Events.on(ConnectionManager, 'localusersignedout', function () {
needsRefresh = true;
});
});
pageClassOn('pageshowready', "type-interior", function () {
var page = $(this);
if (needsRefresh) {
Notifications.updateNotificationCount();
}
});
})(jQuery, document, Dashboard, LibraryBrowser);