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

Fix review issues

This commit is contained in:
Bill Thornton 2022-06-17 02:31:13 -04:00
parent db7f385923
commit 5b5784a448
2 changed files with 5 additions and 3 deletions

View file

@ -96,7 +96,7 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
throw new Error('Public system info request failed'); throw new Error('Public system info request failed');
} }
const systemInfo = await infoResponse.json(); const systemInfo = await infoResponse.json();
if (!systemInfo.StartupWizardCompleted) { if (!systemInfo?.StartupWizardCompleted) {
// Bounce to the wizard // Bounce to the wizard
console.info('[ConnectionRequired] startup wizard is not complete, redirecting there'); console.info('[ConnectionRequired] startup wizard is not complete, redirecting there');
navigate(BounceRoutes.StartWizard); navigate(BounceRoutes.StartWizard);
@ -104,6 +104,7 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
} }
} catch (ex) { } catch (ex) {
console.error('[ConnectionRequired] checking wizard status failed', ex); console.error('[ConnectionRequired] checking wizard status failed', ex);
return;
} }
} }
@ -112,7 +113,8 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
return; return;
} }
// TODO: should exiting the app be handled here? // 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.
const client = ServerConnections.currentApiClient(); const client = ServerConnections.currentApiClient();

View file

@ -13,7 +13,7 @@ const normalizePath = (pathname: string) => pathname.replace(/^!/, '');
* Refs: https://github.com/remix-run/react-router/blob/v6.3.0/packages/react-router-dom/index.tsx#L222 * Refs: https://github.com/remix-run/react-router/blob/v6.3.0/packages/react-router-dom/index.tsx#L222
*/ */
export function HistoryRouter({ basename, children, history }: HistoryRouterProps) { export function HistoryRouter({ basename, children, history }: HistoryRouterProps) {
const [state, setState] = React.useState({ const [state, setState] = React.useState<Update>({
action: history.action, action: history.action,
location: history.location location: history.location
}); });