mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
remove wait for color calc on detail pages causing extra render
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
import { LibraryContainer } from '/@/renderer/features/shared/components/library-container';
|
||||
import { LibraryHeaderBar } from '/@/renderer/features/shared/components/library-header-bar';
|
||||
import { PageErrorBoundary } from '/@/renderer/features/shared/components/page-error-boundary';
|
||||
import { useFastAverageColor, useWaitForColorCalculation } from '/@/renderer/hooks';
|
||||
import { useFastAverageColor } from '/@/renderer/hooks';
|
||||
import { useAlbumBackground, useCurrentServer } from '/@/renderer/store';
|
||||
import { LibraryItem } from '/@/shared/types/domain-types';
|
||||
|
||||
@@ -51,14 +51,7 @@ const AlbumDetailRoute = () => {
|
||||
|
||||
const showBlurredImage = albumBackground;
|
||||
|
||||
const { isReady } = useWaitForColorCalculation({
|
||||
hasImage: !!imageUrl,
|
||||
isLoading: isColorLoading,
|
||||
routeId: albumId,
|
||||
showBlurredImage,
|
||||
});
|
||||
|
||||
if (!isReady) {
|
||||
if (isColorLoading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { LibraryContainer } from '/@/renderer/features/shared/components/library-container';
|
||||
import { LibraryHeaderBar } from '/@/renderer/features/shared/components/library-header-bar';
|
||||
import { PageErrorBoundary } from '/@/renderer/features/shared/components/page-error-boundary';
|
||||
import { useFastAverageColor, useWaitForColorCalculation } from '/@/renderer/hooks';
|
||||
import { useFastAverageColor } from '/@/renderer/hooks';
|
||||
import { useArtistBackground, useCurrentServer, useCurrentServerId } from '/@/renderer/store';
|
||||
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||
import { AlbumListSort, LibraryItem, SortOrder } from '/@/shared/types/domain-types';
|
||||
@@ -76,14 +76,7 @@ const AlbumArtistDetailRouteContent = () => {
|
||||
|
||||
const showBlurredImage = artistBackground;
|
||||
|
||||
const { isReady } = useWaitForColorCalculation({
|
||||
hasImage: !!selectedImageUrl,
|
||||
isLoading: isColorLoading,
|
||||
routeId,
|
||||
showBlurredImage,
|
||||
});
|
||||
|
||||
if (!isReady) {
|
||||
if (isColorLoading) {
|
||||
return <Spinner container />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user