From d9e0082ade097cab6a87f187023df275cbd6c697 Mon Sep 17 00:00:00 2001 From: Kevin Szuchet Date: Wed, 9 Aug 2023 12:33:11 +0200 Subject: [PATCH] feat: Append qs to the root location when redirect from sign in --- src/components/Pages/ConnectToWorld/ConnectToWorld.tsx | 2 +- src/modules/routing/locations.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Pages/ConnectToWorld/ConnectToWorld.tsx b/src/components/Pages/ConnectToWorld/ConnectToWorld.tsx index f2926f5..6d029a2 100644 --- a/src/components/Pages/ConnectToWorld/ConnectToWorld.tsx +++ b/src/components/Pages/ConnectToWorld/ConnectToWorld.tsx @@ -25,7 +25,7 @@ function ConnectToWorld(props: Props) { useEffect(() => { if (!loggedInAddress && !isLoading) { - navigate(locations.signIn(locations.root())) + navigate(locations.signIn(locations.root(worldsContentServerUrl))) } }, [isLoading, loggedInAddress]) diff --git a/src/modules/routing/locations.ts b/src/modules/routing/locations.ts index d59e686..32e419c 100644 --- a/src/modules/routing/locations.ts +++ b/src/modules/routing/locations.ts @@ -1,6 +1,5 @@ export const locations = { - root: () => '/', - account: (address: string) => `/accounts/${address}`, + root: (worldsContentServerUrl?: string) => '/' + (worldsContentServerUrl ? `?worlds-content-server-url=${worldsContentServerUrl}` : ''), signIn: (redirectTo?: string) => { return `/sign-in${redirectTo ? `?redirectTo=${encodeURIComponent(redirectTo)}` : ''}` },