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

Fix home page loading with lazy

This commit is contained in:
Bill Thornton 2024-07-16 17:05:32 -04:00
parent 175b2d6c85
commit 255d982687
5 changed files with 18 additions and 70 deletions

View file

@ -16,8 +16,6 @@ export interface AsyncRoute {
page?: string
/** The page type used to load the correct page element. */
type?: AsyncRouteType
/** Override for pages that don't support lazy importing */
Component?: React.ComponentType | null;
}
const importPage = (page: string, type: AsyncRouteType) => {
@ -34,13 +32,8 @@ const importPage = (page: string, type: AsyncRouteType) => {
export const toAsyncPageRoute = ({
path,
page,
Component,
type = AsyncRouteType.Stable
}: AsyncRoute): RouteObject => {
if (Component) {
return { path, Component };
}
return {
path,
lazy: async () => {