fix container ref instances

This commit is contained in:
jeffvli
2025-11-16 01:10:40 -08:00
parent 4ba7306855
commit 31d9ab048d
14 changed files with 155 additions and 164 deletions
@@ -48,7 +48,7 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
artistId?: string;
};
const routeId = (artistId || albumArtistId) as string;
const cq = useContainerQuery();
const { ref, ...cq } = useContainerQuery();
const handlePlayQueueAdd = usePlayQueueAdd();
const server = useCurrentServer();
const genrePath = useGenreRoute();
@@ -234,10 +234,10 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
detailQuery?.isLoading ||
(server?.type === ServerType.NAVIDROME && enabledItem.topSongs && topSongsQuery?.isLoading);
if (isLoading) return <div className={styles.contentContainer} ref={cq.ref} />;
if (isLoading) return <div className={styles.contentContainer} ref={ref} />;
return (
<div className={styles.contentContainer} ref={cq.ref}>
<div className={styles.contentContainer} ref={ref}>
<LibraryBackgroundOverlay backgroundColor={background} />
<div className={styles.detailContainer}>
<Group gap="md">
@@ -12,11 +12,11 @@ import { AlbumArtistListSort, LibraryItem, SortOrder } from '/@/shared/types/dom
import { ItemListKey } from '/@/shared/types/types';
export const AlbumArtistListHeaderFilters = () => {
const cq = useContainerQuery();
const { ref, ...cq } = useContainerQuery();
return (
<Flex justify="space-between">
<Group gap="sm" ref={cq.ref} w="100%">
<Group gap="sm" ref={ref} w="100%">
<ListSortByDropdown
defaultSortByValue={AlbumArtistListSort.NAME}
itemType={LibraryItem.ALBUM_ARTIST}
@@ -18,14 +18,14 @@ import { ArtistListSort, LibraryItem, SortOrder } from '/@/shared/types/domain-t
import { ItemListKey } from '/@/shared/types/types';
export const ArtistListHeaderFilters = () => {
const cq = useContainerQuery();
const { ref, ...cq } = useContainerQuery();
const server = useCurrentServer();
const rolesQuery = useQuery(sharedQueries.roles({ query: {}, serverId: server.id }));
return (
<Flex justify="space-between">
<Group gap="sm" ref={cq.ref} w="100%">
<Group gap="sm" ref={ref} w="100%">
<ListSortByDropdown
defaultSortByValue={ArtistListSort.NAME}
itemType={LibraryItem.ARTIST}