Skip to content

Commit

Permalink
Escape nullable policies
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Aug 20, 2024
1 parent 5318c6b commit 674dd38
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const cartridge = new CartridgeConnector({
"cartridge-starknet-react-next",
"keychain",
),

rpc: process.env.NEXT_PUBLIC_RPC_SEPOLIA,
paymaster: {
caller: shortString.encodeShortString("ANY_CALLER"),
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/Policies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => (
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/components/connect/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function Form({
await doLogin(usernameField.value, credentialId);
break;
case LoginMode.Controller:
if (policies?.length === 0) {
if (!policies?.length) {
break;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/keychain/src/components/layout/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function Footer({
const isExpandable = useMemo(
() =>
!!origin &&
!!policies.length &&
!!policies?.length &&
variant === "connect" &&
!isSignup &&
!hideTxSummary,
Expand Down Expand Up @@ -100,7 +100,7 @@ export function Footer({
onClick={footer.onToggle}
_hover={{ cursor: "pointer" }}
>
{!hideTxSummary && !!policies.length && (
{!hideTxSummary && !!policies?.length && (
<TransactionSummary
isSlot={isSlot}
createSession={createSession}
Expand Down

0 comments on commit 674dd38

Please sign in to comment.