mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #4898 from thornbill/handle-json-parse
This commit is contained in:
commit
c928d64ea2
2 changed files with 14 additions and 3 deletions
|
@ -53,8 +53,12 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
|
|||
return;
|
||||
case ConnectionState.ServerSelection:
|
||||
// Bounce to select server page
|
||||
console.debug('[ConnectionRequired] redirecting to select server page');
|
||||
navigate(BounceRoutes.SelectServer);
|
||||
if (location.pathname === BounceRoutes.SelectServer) {
|
||||
setIsLoading(false);
|
||||
} else {
|
||||
console.debug('[ConnectionRequired] redirecting to select server page');
|
||||
navigate(BounceRoutes.SelectServer);
|
||||
}
|
||||
return;
|
||||
case ConnectionState.ServerUpdateNeeded:
|
||||
// Show update needed message and bounce to select server page
|
||||
|
|
|
@ -56,9 +56,16 @@ export async function serverAddress() {
|
|||
return;
|
||||
}
|
||||
|
||||
let config;
|
||||
try {
|
||||
config = await resp.json();
|
||||
} catch (err) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
url,
|
||||
config: await resp.json()
|
||||
config
|
||||
};
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue