From 9d02f6cd700d0aaa64baa1302789a44dfa24ae07 Mon Sep 17 00:00:00 2001 From: Luna Seemann Date: Thu, 12 Mar 2026 08:35:20 +0100 Subject: [PATCH] fix: hidden premium reminder displaying `0` (#66) * fix: hidden premium reminder displaying `0` * Handle premium 0 case * fix: lint --- app/(home)/premium/subscribe.component.tsx | 2 +- app/dashboard/[guildId]/layout.tsx | 2 +- app/profile/billing/page.tsx | 2 +- components/header.tsx | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/(home)/premium/subscribe.component.tsx b/app/(home)/premium/subscribe.component.tsx index 7584690..62904ea 100644 --- a/app/(home)/premium/subscribe.component.tsx +++ b/app/(home)/premium/subscribe.component.tsx @@ -17,7 +17,7 @@ const PERIODS = ["month", "year"] as const; export function Subscribe({ header }: { header?: boolean; }) { const search = useSearchParams(); - const premium = userStore((u) => u?.premium || false); + const premium = userStore((u) => u?.premium !== 0); const [donation, setDonation] = useState(0); const [period, setPeriod] = useState<"month" | "year">("month"); diff --git a/app/dashboard/[guildId]/layout.tsx b/app/dashboard/[guildId]/layout.tsx index 1c2a84a..d244b7f 100644 --- a/app/dashboard/[guildId]/layout.tsx +++ b/app/dashboard/[guildId]/layout.tsx @@ -146,7 +146,7 @@ export default function RootLayout({ - {user?.premium && guild && } + {user?.premium !== 0 && guild && } data?.priceId.startsWith("monthly_") ? "month" : "year", [data?.priceId]); const basePrice = useMemo(() => period === "year" ? YEARLY_PRICES[0] : MONTHLY_PRICES[0], [period]); - if ((isLoading && !user?.premium) || (!isLoading && !data) || (data && !isActive(data.status))) { + if ((isLoading && user?.premium === 0) || (!isLoading && !data) || (data && !isActive(data.status))) { return (
{error && error !== "Not Found" && } diff --git a/components/header.tsx b/components/header.tsx index 3dc79ae..2ef498c 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -110,9 +110,9 @@ function Dropdown({ user }: { user: User; }) { - + - {user.premium ? "Billing" : "Premium"} + {user.premium === 0 ? "Premium" : "Billing"} -- 2.51.2