diff --git a/frontend/src/components/ChannelPage.tsx b/frontend/src/components/ChannelPage.tsx index 2c81407..08e259b 100644 --- a/frontend/src/components/ChannelPage.tsx +++ b/frontend/src/components/ChannelPage.tsx @@ -6,6 +6,7 @@ import Avatar from "./Avatar"; import Feed from "./Feed"; import { useConfirm } from "./ConfirmProvider"; import { notify } from "../lib/notifications"; +import { notifyYouTubeActionError } from "../lib/youtubeErrors"; import { api, type FeedFilters, type Me } from "../lib/api"; import { channelYouTubeUrl, formatViews } from "../lib/format"; @@ -89,8 +90,14 @@ export default function ChannelPage({ qc.invalidateQueries({ queryKey: ["channel", channelId] }); qc.invalidateQueries({ queryKey: ["feed"] }); qc.invalidateQueries({ queryKey: ["channels"] }); + // Match ChannelDiscovery: the channel leaves discovery and the manager's stats move. + qc.invalidateQueries({ queryKey: ["my-status"] }); + qc.invalidateQueries({ queryKey: ["discovered-channels"] }); notify({ level: "info", message: t("channel.subscribed", { name: ch?.title ?? "" }) }); }, + // A 403 (missing write scope) otherwise fails silently on the channel page (no wizard handle + // here, so no Connect button — but the user at least sees why it didn't work). + onError: (err) => notifyYouTubeActionError(err, t("channels.discovery.subscribeFailed")), }); const unsubscribe = useMutation({ mutationFn: () => api.unsubscribeChannel(channelId),