1
0
Fork 0
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:
viown 2024-09-08 13:53:29 +03:00 committed by Bill Thornton
parent c33ee1b381
commit 5396e3c95c
2 changed files with 12 additions and 13 deletions

View file

@ -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);
});
}