fix: setup page when alby is not setup yet

feat/alby
Roland Bewick 2023-09-23 16:04:56 +07:00
parent 8ef09fcfd5
commit dd6fe5a385
2 changed files with 12 additions and 5 deletions

View File

@ -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 {

View File

@ -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) {