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

Fix usages of item in location state

This commit is contained in:
Bill Thornton 2024-04-30 15:59:48 -04:00
parent 5dfefb0518
commit 23c15f8259
6 changed files with 144 additions and 92 deletions

View file

@ -6,7 +6,7 @@ import React, { type FC, useCallback } from 'react';
import Box from '@mui/material/Box';
import classNames from 'classnames';
import { useLocalStorage } from 'hooks/useLocalStorage';
import { useGetItem, useGetItemsViewByType } from 'hooks/useFetchItems';
import { useGetItemsViewByType } from 'hooks/useFetchItems';
import { getDefaultLibraryViewSettings, getSettingsKey } from 'utils/items';
import { CardShape } from 'utils/card';
import Loading from 'components/loading/LoadingComponent';
@ -28,6 +28,7 @@ import { LibraryTab } from 'types/libraryTab';
import { type LibraryViewSettings, type ParentId, ViewMode } from 'types/library';
import type { CardOptions } from 'types/cardOptions';
import type { ListOptions } from 'types/listOptions';
import { useItem } from 'hooks/useItem';
interface ItemsViewProps {
viewType: LibraryTab;
@ -79,7 +80,7 @@ const ItemsView: FC<ItemsViewProps> = ({
itemType,
libraryViewSettings
);
const { data: item } = useGetItem(parentId);
const { data: item } = useItem(parentId || undefined);
const getListOptions = useCallback(() => {
const listOptions: ListOptions = {