mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix merge conflict
This commit is contained in:
parent
c33ee1b381
commit
5396e3c95c
2 changed files with 12 additions and 13 deletions
|
@ -1,3 +1,4 @@
|
|||
import ServerConnections from 'components/ServerConnections';
|
||||
import { playbackManager } from '../components/playback/playbackmanager';
|
||||
import Events from '../utils/events.ts';
|
||||
|
||||
|
@ -43,16 +44,14 @@ function onOpen() {
|
|||
});
|
||||
}
|
||||
|
||||
export function initialize(apiClient) {
|
||||
if (apiClient) {
|
||||
if (apiClient.isWebSocketOpen()) {
|
||||
console.debug('[autoCast] connection ready');
|
||||
onOpen();
|
||||
} else {
|
||||
console.debug('[autoCast] initializing connection listener');
|
||||
Events.on(apiClient, 'websocketopen', onOpen);
|
||||
}
|
||||
} else {
|
||||
console.warn('[autoCast] cannot initialize missing apiClient');
|
||||
}
|
||||
export function initialize() {
|
||||
ServerConnections.getApiClients().forEach(apiClient => {
|
||||
Events.off(apiClient, 'websocketopen', onOpen);
|
||||
Events.on(apiClient, 'websocketopen', onOpen);
|
||||
});
|
||||
|
||||
Events.on(ServerConnections, 'apiclientcreated', (e, apiClient) => {
|
||||
Events.off(apiClient, 'websocketopen', onOpen);
|
||||
Events.on(apiClient, 'websocketopen', onOpen);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue