From dd6fe5a385a0bd022f38738fb5f3477854c0ed99 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Sat, 23 Sep 2023 16:04:56 +0700 Subject: [PATCH] fix: setup page when alby is not setup yet --- .../alby/pages/setup/_getServerSideProps.tsx | 13 ++++++++++--- packages/app-store/alby/pages/setup/index.tsx | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/app-store/alby/pages/setup/_getServerSideProps.tsx b/packages/app-store/alby/pages/setup/_getServerSideProps.tsx index dee944924b..23001de184 100644 --- a/packages/app-store/alby/pages/setup/_getServerSideProps.tsx +++ b/packages/app-store/alby/pages/setup/_getServerSideProps.tsx @@ -21,11 +21,18 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => { }, }); - const props: IAlbySetupProps = {}; + const props: IAlbySetupProps = { + email: null, + lightningAddress: null, + }; if (credentials?.key) { const { account_lightning_address, account_email } = credentials.key; - props.email = account_email; - props.lightningAddress = account_lightning_address; + if (account_lightning_address) { + props.lightningAddress = account_lightning_address; + } + if (account_email) { + props.email = account_email; + } } return { diff --git a/packages/app-store/alby/pages/setup/index.tsx b/packages/app-store/alby/pages/setup/index.tsx index cb7fd86b81..3384bd954b 100644 --- a/packages/app-store/alby/pages/setup/index.tsx +++ b/packages/app-store/alby/pages/setup/index.tsx @@ -12,8 +12,8 @@ import { Info } from "@calcom/ui/components/icon"; import { albyCredentialKeysSchema } from "../../lib/albyCredentialKeysSchema"; export interface IAlbySetupProps { - email?: string; - lightningAddress?: string; + email: string | null; + lightningAddress: string | null; } export default function AlbySetup(props: IAlbySetupProps) {