From c767497d9c207ee5e13f1c1b757827d20de4fe3e Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 7 Dec 2022 12:06:26 +0100 Subject: [PATCH] session context hotfix --- package.json | 1 + src/context/session.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 738849c1..d4ace093 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "server": "node server/server.mjs", "start": "astro dev", "start:local": "cross-env PUBLIC_API_URL=http://127.0.0.1:8080 astro dev", + "start:production": "cross-env PUBLIC_API_URL=https://v2.discours.io astro dev", "start:staging": "cross-env PUBLIC_API_URL=https://testapi.discours.io astro dev", "typecheck": "astro check && tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", diff --git a/src/context/session.tsx b/src/context/session.tsx index 211fe843..0c1751aa 100644 --- a/src/context/session.tsx +++ b/src/context/session.tsx @@ -33,12 +33,13 @@ export const SessionProvider = (props: { children: JSX.Element }) => { return null } setToken(authResult.token) - setIsSessionLoaded(true) return authResult } catch (error) { console.error('getSession error:', error) resetToken() return null + } finally { + setIsSessionLoaded(true) } }