mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-02 07:52:34 +00:00
feat: hide sections when empty by default
This commit is contained in:
@@ -431,6 +431,7 @@ export default function index() {
|
||||
queryKey={section.queryKey}
|
||||
queryFn={section.queryFn}
|
||||
orientation={section.orientation}
|
||||
hideIfEmpty
|
||||
/>
|
||||
);
|
||||
} else if (section.type === "MediaListSection") {
|
||||
|
||||
@@ -28,7 +28,7 @@ export const ScrollingCollectionList: React.FC<Props> = ({
|
||||
disabled = false,
|
||||
queryFn,
|
||||
queryKey,
|
||||
hideIfEmpty = false,
|
||||
hideIfEmpty = true,
|
||||
...props
|
||||
}) => {
|
||||
const { data, isLoading } = useQuery({
|
||||
@@ -42,8 +42,7 @@ export const ScrollingCollectionList: React.FC<Props> = ({
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
// hideIfEmpty is deprecated, we always hide when there is no data
|
||||
if (hideIfEmpty === true || data?.length === 0) return null;
|
||||
if (hideIfEmpty === true && data?.length === 0) return null;
|
||||
if (disabled || !title) return null;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user