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

Remove app router routing

This commit is contained in:
Bill Thornton 2024-09-04 17:06:37 -04:00
parent 9d6e266cf8
commit 99b2bd4f6e
4 changed files with 54 additions and 345 deletions

View file

@ -3,7 +3,6 @@ import { Outlet, useLocation, useNavigate } from 'react-router-dom';
import type { ConnectResponse } from 'jellyfin-apiclient';
import alert from './alert';
import { appRouter } from './router/appRouter';
import Loading from './loading/LoadingComponent';
import ServerConnections from './ServerConnections';
import globalize from '../lib/globalize';
@ -149,24 +148,20 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
}, [bounce, isAdminRequired, isUserRequired]);
useEffect(() => {
// TODO: appRouter will call appHost.exit() if navigating back when you are already at the default route.
// This case will need to be handled elsewhere before appRouter can be killed.
// Check connection status on initial page load
const firstConnection = appRouter.firstConnectionResult;
appRouter.firstConnectionResult = null;
ServerConnections.connect()
.then(firstConnection => {
console.debug('[ConnectionRequired] connection state', firstConnection?.State);
if (firstConnection && firstConnection.State !== ConnectionState.SignedIn) {
handleIncompleteWizard(firstConnection)
.catch(err => {
console.error('[ConnectionRequired] failed to start wizard', err);
});
} else {
validateUserAccess()
.catch(err => {
console.error('[ConnectionRequired] failed to validate user access', err);
});
}
if (firstConnection && firstConnection.State !== ConnectionState.SignedIn) {
return handleIncompleteWizard(firstConnection);
} else {
return validateUserAccess();
}
})
.catch(err => {
console.error('[ConnectionRequired] failed to connect to server', err);
});
}, [handleIncompleteWizard, validateUserAccess]);
if (isLoading) {