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

added connection manager events

This commit is contained in:
Luke Pulverenti 2015-02-23 13:55:38 -05:00
parent 863f797c56
commit 3c0f048165

View file

@ -454,7 +454,8 @@
self.isLoggedIntoConnect = function () { self.isLoggedIntoConnect = function () {
return self.connectToken() && self.connectUserId(); // Make sure it returns true or false
return (self.connectToken() && self.connectUserId()) == true;
}; };
self.logout = function () { self.logout = function () {
@ -466,7 +467,7 @@
var apiClient = apiClients[i]; var apiClient = apiClients[i];
if (apiClient.accessToken()) { if (apiClient.accessToken()) {
promises.push(apiClient.logout()); promises.push(logoutOfServer(apiClient));
} }
} }
@ -506,6 +507,20 @@
}); });
}; };
function logoutOfServer(apiClient) {
var serverInfo = apiClient.serverInfo();
var logoutInfo = {
serverId: serverInfo.Id
};
return apiClient.logout().always(function () {
Events.trigger(self, 'localusersignedout', [logoutInfo]);
});
}
function getConnectServers(credentials) { function getConnectServers(credentials) {
logger.log('Begin getConnectServers'); logger.log('Begin getConnectServers');