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

Add connection response handling

This commit is contained in:
Dmitry Lyzo 2021-03-22 23:34:48 +03:00
parent e27131edf0
commit af6d3f2e63

View file

@ -503,7 +503,8 @@ class AppRouter {
const firstResult = this.firstConnectionResult; const firstResult = this.firstConnectionResult;
this.firstConnectionResult = null; this.firstConnectionResult = null;
if (firstResult && firstResult.State === 'ServerSignIn') { if (firstResult) {
if (firstResult.State === 'ServerSignIn') {
const url = firstResult.ApiClient.serverAddress() + '/System/Info/Public'; const url = firstResult.ApiClient.serverAddress() + '/System/Info/Public';
fetch(url).then(response => { fetch(url).then(response => {
if (!response.ok) return Promise.reject('fetch failed'); if (!response.ok) return Promise.reject('fetch failed');
@ -520,6 +521,10 @@ class AppRouter {
}); });
return; return;
} else if (firstResult.State !== 'SignedIn') {
this.handleConnectionResult(firstResult);
return;
}
} }
const apiClient = ServerConnections.currentApiClient(); const apiClient = ServerConnections.currentApiClient();