The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: hidden premium reminder displaying `0` (#66)

* fix: hidden premium reminder displaying `0`

* Handle premium 0 case

* fix: lint

authored by

Luna Seemann and committed by
GitHub
9d02f6cd ca89c227

+5 -5
+1 -1
app/(home)/premium/subscribe.component.tsx
··· 17 17 export function Subscribe({ header }: { header?: boolean; }) { 18 18 const search = useSearchParams(); 19 19 20 - const premium = userStore((u) => u?.premium || false); 20 + const premium = userStore((u) => u?.premium !== 0); 21 21 const [donation, setDonation] = useState(0); 22 22 const [period, setPeriod] = useState<"month" | "year">("month"); 23 23
+1 -1
app/dashboard/[guildId]/layout.tsx
··· 146 146 </div> 147 147 </div> 148 148 149 - {user?.premium && guild && <PremiumReminder guild={guild} />} 149 + {user?.premium !== 0 && guild && <PremiumReminder guild={guild} />} 150 150 151 151 <Suspense> 152 152 <ListTab
+1 -1
app/profile/billing/page.tsx
··· 36 36 const period = useMemo(() => data?.priceId.startsWith("monthly_") ? "month" : "year", [data?.priceId]); 37 37 const basePrice = useMemo(() => period === "year" ? YEARLY_PRICES[0] : MONTHLY_PRICES[0], [period]); 38 38 39 - if ((isLoading && !user?.premium) || (!isLoading && !data) || (data && !isActive(data.status))) { 39 + if ((isLoading && user?.premium === 0) || (!isLoading && !data) || (data && !isActive(data.status))) { 40 40 return ( 41 41 <div className="space-y-4"> 42 42 {error && error !== "Not Found" && <Notice message={error} />}
+2 -2
components/header.tsx
··· 110 110 </Link> 111 111 </DropdownMenuItem> 112 112 <DropdownMenuItem asChild> 113 - <Link href={user.premium ? "/profile/billing" : "/premium"}> 113 + <Link href={user.premium === 0 ? "/premium" : "/profile/billing"}> 114 114 <HiSparkles /> 115 - {user.premium ? "Billing" : "Premium"} 115 + {user.premium === 0 ? "Premium" : "Billing"} 116 116 </Link> 117 117 </DropdownMenuItem> 118 118 </DropdownMenuGroup>