re-add default suspense to album/artist routes

This commit is contained in:
jeffvli
2026-04-04 22:25:21 -07:00
parent 6c73d06dcf
commit 3e5a8ac78d
9 changed files with 42 additions and 56 deletions
+1 -7
View File
@@ -1,12 +1,12 @@
import clsx from 'clsx';
import isElectron from 'is-electron';
import { lazy } from 'react';
import styles from './default-layout.module.css';
import { ContextMenuController } from '/@/renderer/features/context-menu/context-menu-controller';
import { MainContent } from '/@/renderer/layouts/default-layout/main-content';
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
import { WindowBar } from '/@/renderer/layouts/window-bar';
import { useSettingsStore, useWindowBarStyle } from '/@/renderer/store/settings.store';
import { Platform, PlayerType } from '/@/shared/types/types';
@@ -18,12 +18,6 @@ if (!isElectron()) {
});
}
const WindowBar = lazy(() =>
import('/@/renderer/layouts/window-bar').then((module) => ({
default: module.WindowBar,
})),
);
interface DefaultLayoutProps {
shell?: boolean;
}
@@ -1,6 +1,6 @@
import clsx from 'clsx';
import { AnimatePresence } from 'motion/react';
import { lazy } from 'react';
import { lazy, Suspense } from 'react';
import { Outlet } from 'react-router';
import styles from './mobile-layout.module.css';
@@ -13,6 +13,7 @@ import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
import { useFullScreenPlayerOverlayState, useWindowBarStyle } from '/@/renderer/store';
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
import { Drawer } from '/@/shared/components/drawer/drawer';
import { Spinner } from '/@/shared/components/spinner/spinner';
import { useDisclosure } from '/@/shared/hooks/use-disclosure';
import { Platform } from '/@/shared/types/types';
@@ -53,7 +54,9 @@ export const MobileLayout = ({ shell }: MobileLayoutProps) => {
variant="subtle"
/>
<main className={styles.mainContent}>
<Outlet />
<Suspense fallback={<Spinner container />}>
<Outlet />
</Suspense>
</main>
<PlayerBar />
</div>