fix(desktop): mark hiding a list from the timeline as a paid feature

Free users could turn on Hide from Timeline when following or editing a
list, which the plan does not include. The switch now shows the paid badge
and is disabled for them, like Private Follow. A list that already has
either switch on keeps it usable, so it can still be turned off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DIYgod
2026-10-12 21:05:21 +08:00
parent 5cc603d21b
commit 575e9c0bf4
@@ -267,10 +267,14 @@ const ListInnerForm = ({
const t = useI18n()
// Private follow is a paid feature for lists too, as in the feed form
// Private follow and hiding from the timeline are paid features for lists too, as in the feed
// form. Only turning them on needs the plan, so after a downgrade a list that has one on
// still lets the user turn it off.
const role = useUserRole()
const isPaymentEnabled = useIsPaymentEnabled()
const disabledForRole = role === UserRole.Free && isPaymentEnabled
const isPrivateAlready = subscription?.isPrivate === true
const isHiddenAlready = subscription?.hideFromTimeline === true
return (
<div className="flex flex-1 flex-col gap-y-4">
@@ -327,7 +331,7 @@ const ListInnerForm = ({
className="shrink-0"
checked={field.value}
onCheckedChange={field.onChange}
disabled={disabledForRole}
disabled={disabledForRole && !isPrivateAlready}
/>
</FormControl>
</div>
@@ -341,7 +345,10 @@ const ListInnerForm = ({
<FormItem>
<div className="flex items-center justify-between">
<div>
<FormLabel>{t("feed_form.hide_from_timeline")}</FormLabel>
<FormLabel className="flex items-center gap-1">
<span>{t("feed_form.hide_from_timeline")}</span>
<PaidBadge />
</FormLabel>
<FormDescription>
{t("feed_form.hide_from_timeline_description")}
</FormDescription>
@@ -351,6 +358,7 @@ const ListInnerForm = ({
className="shrink-0"
checked={field.value}
onCheckedChange={field.onChange}
disabled={disabledForRole && !isHiddenAlready}
/>
</FormControl>
</div>