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
|
@ -74,7 +74,7 @@ build: ${__JF_BUILD_VERSION__}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize automatic (default) cast target
|
// Initialize automatic (default) cast target
|
||||||
initializeAutoCast(ServerConnections.currentApiClient());
|
initializeAutoCast();
|
||||||
|
|
||||||
// Load the translation dictionary
|
// Load the translation dictionary
|
||||||
await loadCoreDictionary();
|
await loadCoreDictionary();
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import ServerConnections from 'components/ServerConnections';
|
||||||
import { playbackManager } from '../components/playback/playbackmanager';
|
import { playbackManager } from '../components/playback/playbackmanager';
|
||||||
import Events from '../utils/events.ts';
|
import Events from '../utils/events.ts';
|
||||||
|
|
||||||
|
@ -43,16 +44,14 @@ function onOpen() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initialize(apiClient) {
|
export function initialize() {
|
||||||
if (apiClient) {
|
ServerConnections.getApiClients().forEach(apiClient => {
|
||||||
if (apiClient.isWebSocketOpen()) {
|
Events.off(apiClient, 'websocketopen', onOpen);
|
||||||
console.debug('[autoCast] connection ready');
|
Events.on(apiClient, 'websocketopen', onOpen);
|
||||||
onOpen();
|
});
|
||||||
} else {
|
|
||||||
console.debug('[autoCast] initializing connection listener');
|
Events.on(ServerConnections, 'apiclientcreated', (e, apiClient) => {
|
||||||
Events.on(apiClient, 'websocketopen', onOpen);
|
Events.off(apiClient, 'websocketopen', onOpen);
|
||||||
}
|
Events.on(apiClient, 'websocketopen', onOpen);
|
||||||
} else {
|
});
|
||||||
console.warn('[autoCast] cannot initialize missing apiClient');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue