This commit is contained in:
Karol Wypchlo 2021-03-03 16:15:41 +01:00
parent 73a411c9b2
commit c8c9d216ee
1 changed files with 2 additions and 2 deletions

View File

@ -53,8 +53,8 @@ const ActiveBadge = () => {
export default function Payments() { export default function Payments() {
const { data: user } = useSWR(`${apiPrefix}/user`, fetcher); const { data: user } = useSWR(`${apiPrefix}/user`, fetcher);
const [selectedPlan, setSelectedPlan] = useState(plans[0]); const [selectedPlan, setSelectedPlan] = useState(plans[0]);
const activePlan = plans.find(({ tier }) => user?.tier === tier); const activePlan = plans.find((plan) => user?.tier === plan?.tier);
const isFreePlan = ({ tier }) => tier === 1; const isFreePlan = (plan) => plan?.tier === 1;
const handleSubscribe = async () => { const handleSubscribe = async () => {
try { try {
const price = selectedPlan.stripe; const price = selectedPlan.stripe;