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:
parent
863f797c56
commit
3c0f048165
1 changed files with 17 additions and 2 deletions
|
@ -454,7 +454,8 @@
|
|||
|
||||
self.isLoggedIntoConnect = function () {
|
||||
|
||||
return self.connectToken() && self.connectUserId();
|
||||
// Make sure it returns true or false
|
||||
return (self.connectToken() && self.connectUserId()) == true;
|
||||
};
|
||||
|
||||
self.logout = function () {
|
||||
|
@ -466,7 +467,7 @@
|
|||
var apiClient = apiClients[i];
|
||||
|
||||
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) {
|
||||
|
||||
logger.log('Begin getConnectServers');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue