mirror of https://github.com/stashapp/stash.git
Fix rating display in filter tags (#5334)
This commit is contained in:
parent
9765b6d50e
commit
c92de09ece
|
@ -1,6 +1,7 @@
|
||||||
import React, {
|
import React, {
|
||||||
PropsWithChildren,
|
PropsWithChildren,
|
||||||
useCallback,
|
useCallback,
|
||||||
|
useContext,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
|
@ -36,6 +37,7 @@ import {
|
||||||
IItemListOperation,
|
IItemListOperation,
|
||||||
} from "./FilteredListToolbar";
|
} from "./FilteredListToolbar";
|
||||||
import { PagedList } from "./PagedList";
|
import { PagedList } from "./PagedList";
|
||||||
|
import { ConfigurationContext } from "src/hooks/Config";
|
||||||
|
|
||||||
interface IItemListProps<T extends QueryResult, E extends IHasID> {
|
interface IItemListProps<T extends QueryResult, E extends IHasID> {
|
||||||
view?: View;
|
view?: View;
|
||||||
|
@ -304,18 +306,20 @@ export const ItemListContext = <T extends QueryResult, E extends IHasID>(
|
||||||
children,
|
children,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
const { configuration: config } = useContext(ConfigurationContext);
|
||||||
|
|
||||||
const emptyFilter = useMemo(
|
const emptyFilter = useMemo(
|
||||||
() =>
|
() =>
|
||||||
providedDefaultFilter?.clone() ??
|
providedDefaultFilter?.clone() ??
|
||||||
new ListFilterModel(filterMode, undefined, {
|
new ListFilterModel(filterMode, config, {
|
||||||
defaultSortBy: defaultSort,
|
defaultSortBy: defaultSort,
|
||||||
}),
|
}),
|
||||||
[filterMode, defaultSort, providedDefaultFilter]
|
[config, filterMode, defaultSort, providedDefaultFilter]
|
||||||
);
|
);
|
||||||
|
|
||||||
const [filter, setFilterState] = useState<ListFilterModel>(
|
const [filter, setFilterState] = useState<ListFilterModel>(
|
||||||
() =>
|
() =>
|
||||||
new ListFilterModel(filterMode, undefined, { defaultSortBy: defaultSort })
|
new ListFilterModel(filterMode, config, { defaultSortBy: defaultSort })
|
||||||
);
|
);
|
||||||
|
|
||||||
const { defaultFilter, loading: defaultFilterLoading } = useDefaultFilter(
|
const { defaultFilter, loading: defaultFilterLoading } = useDefaultFilter(
|
||||||
|
|
Loading…
Reference in New Issue