adjust bg loading on album detail page

This commit is contained in:
jeffvli
2026-04-03 20:11:10 -07:00
parent ec9e4b1339
commit d4e9b9b7a6
2 changed files with 6 additions and 9 deletions
@@ -17,9 +17,10 @@ import { LibraryHeaderBar } from '/@/renderer/features/shared/components/library
import { PageErrorBoundary } from '/@/renderer/features/shared/components/page-error-boundary';
import { useFastAverageColor } from '/@/renderer/hooks';
import { useAlbumBackground, useCurrentServer } from '/@/renderer/store';
import { Spinner } from '/@/shared/components/spinner/spinner';
import { LibraryItem } from '/@/shared/types/domain-types';
const ALBUM_DETAIL_BG_FALLBACK = 'var(--theme-colors-foreground-muted)';
const AlbumDetailRoute = () => {
const scrollAreaRef = useRef<HTMLDivElement>(null);
const headerRef = useRef<HTMLDivElement>(null);
@@ -42,25 +43,21 @@ const AlbumDetailRoute = () => {
type: 'itemCard',
}) || '';
const { background: backgroundColor, isLoading: isColorLoading } = useFastAverageColor({
const { background: backgroundColor } = useFastAverageColor({
id: albumId,
src: imageUrl,
srcLoaded: true,
});
const background = backgroundColor;
const background = backgroundColor ?? ALBUM_DETAIL_BG_FALLBACK;
const showBlurredImage = albumBackground;
if (isColorLoading) {
return <Spinner container />;
}
return (
<AnimatedPage key={`album-detail-${albumId}`}>
<NativeScrollArea
pageHeaderProps={{
backgroundColor: backgroundColor || undefined,
backgroundColor: backgroundColor ?? ALBUM_DETAIL_BG_FALLBACK,
children: (
<LibraryHeaderBar>
<LibraryHeaderBar.PlayButton
+1 -1
View File
@@ -341,5 +341,5 @@ export const AppRouter = () => {
</HashRouter>
);
return <Suspense fallback={<></>}>{router}</Suspense>;
return <Suspense fallback={<Spinner container />}>{router}</Suspense>;
};