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

Fix restoring views

This commit is contained in:
Bill Thornton 2022-10-24 02:17:35 -04:00
parent 42c0516a44
commit c5072f77f5
2 changed files with 11 additions and 4 deletions

View file

@ -4,7 +4,7 @@ import { useLocation } from 'react-router-dom';
import globalize from '../../scripts/globalize';
import viewManager from './viewManager';
interface ViewManagerPageProps {
export interface ViewManagerPageProps {
controller: string
view: string
type?: string
@ -35,7 +35,7 @@ const ViewManagerPage: FunctionComponent<ViewManagerPageProps> = ({
let viewHtml = await import(/* webpackChunkName: "[request]" */ `../../controllers/${view}`);
viewHtml = globalize.translateHtml(viewHtml);
viewManager.loadView({
const viewOptions = {
url: location.pathname + location.search,
controllerFactory,
view: viewHtml,
@ -48,7 +48,14 @@ const ViewManagerPage: FunctionComponent<ViewManagerPageProps> = ({
supportsThemeMedia: isThemeMediaSupported,
enableMediaControl: isNowPlayingBarEnabled
}
});
};
viewManager.tryRestoreView(viewOptions)
.catch((result?: any) => {
if (!result || !result.cancelled) {
viewManager.loadView(viewOptions);
}
});
};
loadPage();