Skip to content

Commit

Permalink
Fix rating display in filter tags
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants committed Oct 3, 2024
1 parent 9765b6d commit c477a92
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ui/v2.5/src/components/List/ItemList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {
PropsWithChildren,
useCallback,
useContext,
useEffect,
useMemo,
useState,
Expand Down Expand Up @@ -36,6 +37,7 @@ import {
IItemListOperation,
} from "./FilteredListToolbar";
import { PagedList } from "./PagedList";
import { ConfigurationContext } from "src/hooks/Config";

interface IItemListProps<T extends QueryResult, E extends IHasID> {
view?: View;
Expand Down Expand Up @@ -304,18 +306,20 @@ export const ItemListContext = <T extends QueryResult, E extends IHasID>(
children,
} = props;

const { configuration: config } = useContext(ConfigurationContext);

const emptyFilter = useMemo(
() =>
providedDefaultFilter?.clone() ??
new ListFilterModel(filterMode, undefined, {
new ListFilterModel(filterMode, config, {
defaultSortBy: defaultSort,
}),
[filterMode, defaultSort, providedDefaultFilter]
[config, filterMode, defaultSort, providedDefaultFilter]
);

const [filter, setFilterState] = useState<ListFilterModel>(
() =>
new ListFilterModel(filterMode, undefined, { defaultSortBy: defaultSort })
new ListFilterModel(filterMode, config, { defaultSortBy: defaultSort })
);

const { defaultFilter, loading: defaultFilterLoading } = useDefaultFilter(
Expand Down

0 comments on commit c477a92

Please sign in to comment.