fix(channel): inherit content-type filters instead of forcing Live/Upcoming
Opening a channel hardcoded includeLive:true (+ normal on / shorts off), so a channel view silently showed live/upcoming even when the feed had them off. Seed the content triad from the global feed once at mount; the channel toolbar can still toggle them locally.
This commit is contained in:
@@ -6,6 +6,7 @@ import { ArrowLeft, Ban, Check, ExternalLink, Loader2, Plus, RefreshCw, SlidersH
|
|||||||
import Avatar from "./Avatar";
|
import Avatar from "./Avatar";
|
||||||
import Feed from "./Feed";
|
import Feed from "./Feed";
|
||||||
import { PageToolbar, PageToolbarSlot } from "./PageShell";
|
import { PageToolbar, PageToolbarSlot } from "./PageShell";
|
||||||
|
import { useFeedFilters } from "./FeedFiltersProvider";
|
||||||
import { useConfirm } from "./ConfirmProvider";
|
import { useConfirm } from "./ConfirmProvider";
|
||||||
import { notify } from "../lib/notifications";
|
import { notify } from "../lib/notifications";
|
||||||
import { notifyYouTubeActionError } from "../lib/youtubeErrors";
|
import { notifyYouTubeActionError } from "../lib/youtubeErrors";
|
||||||
@@ -76,6 +77,11 @@ export default function ChannelPage({
|
|||||||
const { closeChannel } = useNavigationActions();
|
const { closeChannel } = useNavigationActions();
|
||||||
const qc = useQueryClient();
|
const qc = useQueryClient();
|
||||||
const confirm = useConfirm();
|
const confirm = useConfirm();
|
||||||
|
// Seed the channel view's content-type prefs from the global feed (read once at mount). The
|
||||||
|
// channel page is its own filter scope, but WHICH content types the user wants to see (normal /
|
||||||
|
// shorts / live-upcoming) is a genuine preference, not part of "this channel's catalog" — so we
|
||||||
|
// inherit it instead of forcing Live/Upcoming on. The channel toolbar can still toggle these.
|
||||||
|
const globalFilters = useFeedFilters();
|
||||||
const [tab, setTab] = useState<"videos" | "about">("videos");
|
const [tab, setTab] = useState<"videos" | "about">("videos");
|
||||||
// The whole channel chrome (banner, identity, tabs, toolbar) is fixed: it portals into the shell's
|
// The whole channel chrome (banner, identity, tabs, toolbar) is fixed: it portals into the shell's
|
||||||
// fixed band so only the video grid scrolls. This node sits at the bottom of that chrome and is
|
// fixed band so only the video grid scrolls. This node sits at the bottom of that chrome and is
|
||||||
@@ -182,9 +188,10 @@ export default function ChannelPage({
|
|||||||
sort: "newest",
|
sort: "newest",
|
||||||
scope: "all",
|
scope: "all",
|
||||||
librarySource: "all",
|
librarySource: "all",
|
||||||
includeNormal: true,
|
// Content-type prefs inherited from the global feed (seeded once) — no longer forced.
|
||||||
includeShorts: false,
|
includeNormal: globalFilters.includeNormal,
|
||||||
includeLive: true,
|
includeShorts: globalFilters.includeShorts,
|
||||||
|
includeLive: globalFilters.includeLive,
|
||||||
show: "all",
|
show: "all",
|
||||||
channelIds: [channelId],
|
channelIds: [channelId],
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user