From 6c70bb4c8fb2ff8cbbfa8e25feb309f2553d6ae6 Mon Sep 17 00:00:00 2001 From: Nasr Date: Sun, 25 Aug 2024 12:21:46 -0400 Subject: [PATCH] format --- packages/keychain/src/pages/session.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/keychain/src/pages/session.tsx b/packages/keychain/src/pages/session.tsx index 800c49d72..739287106 100644 --- a/packages/keychain/src/pages/session.tsx +++ b/packages/keychain/src/pages/session.tsx @@ -1,7 +1,10 @@ "use client"; import { Policy } from "@cartridge/controller"; -import { CreateController, CreateSession as CreateSessionComp } from "components/connect"; +import { + CreateController, + CreateSession as CreateSessionComp, +} from "components/connect"; import { useConnection } from "hooks/connection"; import { useRouter } from "next/router"; @@ -20,8 +23,7 @@ export default function CreateRemoteSession() { const router = useRouter(); const queries = router.query as SessionQueryParams; - const { controller, policies, origin } = - useConnection(); + const { controller, policies, origin } = useConnection(); const navigateBackHere = useCallback(() => { router.replace({ @@ -116,7 +118,10 @@ export default function CreateRemoteSession() { }, [controller, origin, policies, onCallback]); return controller ? ( - + ) : ( ); @@ -129,7 +134,10 @@ function sanitizeCallbackUrl(url: string): URL | undefined { try { const parsed = new URL(url); - if (parsed.hostname.endsWith("cartridge.gg") || (parsed.pathname !== "/" && parsed.pathname !== "/callback")) { + if ( + parsed.hostname.endsWith("cartridge.gg") || + (parsed.pathname !== "/" && parsed.pathname !== "/callback") + ) { throw new Error(`Invalid callback url: ${url}`); } @@ -137,4 +145,4 @@ function sanitizeCallbackUrl(url: string): URL | undefined { } catch (e) { console.error(e); } -} \ No newline at end of file +}