From 6b0e615c69af5375b22c916d79eca2352b82eb1b Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Tue, 20 Aug 2024 16:53:45 +0200 Subject: [PATCH] Escape nullable policies --- packages/keychain/src/Policies.tsx | 2 +- packages/keychain/src/components/layout/Footer/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/keychain/src/Policies.tsx b/packages/keychain/src/Policies.tsx index 3f4bfe1ed..29037ff98 100644 --- a/packages/keychain/src/Policies.tsx +++ b/packages/keychain/src/Policies.tsx @@ -48,7 +48,7 @@ export function Policies({ // The container already set border radius (for top & bottom), but we // set the bottom radius for the last item here because for certain // browsers' scrolling behaviour (eg Firefox) just to make it look nicer. - borderBottomRadius={i === policies.length - 1 ? "base" : "none"} + borderBottomRadius={i === policies?.length - 1 ? "base" : "none"} > {({ isExpanded }) => ( <> diff --git a/packages/keychain/src/components/layout/Footer/index.tsx b/packages/keychain/src/components/layout/Footer/index.tsx index abb049401..dd0a11ccf 100644 --- a/packages/keychain/src/components/layout/Footer/index.tsx +++ b/packages/keychain/src/components/layout/Footer/index.tsx @@ -32,7 +32,7 @@ export function Footer({ const isExpandable = useMemo( () => !!origin && - !!policies.length && + !!policies?.length && variant === "connect" && !isSignup && !hideTxSummary, @@ -100,7 +100,7 @@ export function Footer({ onClick={footer.onToggle} _hover={{ cursor: "pointer" }} > - {!hideTxSummary && !!policies.length && ( + {!hideTxSummary && !!policies?.length && (