From 113d18d84ee081c6be405d01d70859632c1f8e75 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Wed, 15 Sep 2021 21:36:55 +0100 Subject: [PATCH] Only show alert to upgrade when applicable and fix button (#661) Co-authored-by: Bailey Pumfleet --- pages/event-types/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/event-types/index.tsx b/pages/event-types/index.tsx index 9618fbab87..846d6da324 100644 --- a/pages/event-types/index.tsx +++ b/pages/event-types/index.tsx @@ -274,7 +274,7 @@ const EventTypesPage = (props: PageProps) => { ) }> - {props.user.plan === "FREE" && typeof window !== "undefined" && ( + {props.user.plan === "FREE" && !props.canAddEvents && typeof window !== "undefined" && ( You need to upgrade your plan to have more than one active event type.} @@ -720,7 +720,7 @@ export async function getServerSideProps(context) { createdDate: user.createdDate.toString(), }); - const canAddEvents = user.plan !== "FREE" || eventTypes.length < 1; + const canAddEvents = user.plan !== "FREE" || eventTypes[0].eventTypes.length < 1; return { props: {