jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/serviceworker/notifications.js
Luke Pulverenti 8a6884abef minify
2017-01-27 18:07:14 -05:00

1 line
815 B
JavaScript

!function(){"use strict";function getApiClient(serverId){return connectionManager?Promise.resolve(connectionManager.getApiClient(serverId)):Promise.reject()}function executeAction(action,data,serverId){return getApiClient(serverId).then(function(apiClient){switch(action){case"cancel-install":var id=data.id;return apiClient.cancelPackageInstallation(id);case"restart":return apiClient.restartServer();default:return clients.openWindow("/"),Promise.resolve()}})}var connectionManager;self.addEventListener("notificationclick",function(event){var notification=event.notification;notification.close();var data=notification.data,serverId=data.serverId,action=event.action;return action?void event.waitUntil(executeAction(action,data,serverId)):(clients.openWindow("/"),void event.waitUntil(Promise.resolve()))},!1)}();