From b8e3e4994ec291565b22ca8d9249d61faba7c582 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 6 Sep 2023 10:15:46 -0700 Subject: [PATCH] fix(core): location.state maybe null (#4236) --- apps/core/src/pages/sign-in.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/core/src/pages/sign-in.tsx b/apps/core/src/pages/sign-in.tsx index d59223101b..38a2107ab1 100644 --- a/apps/core/src/pages/sign-in.tsx +++ b/apps/core/src/pages/sign-in.tsx @@ -9,7 +9,7 @@ import { AuthPanel } from '../components/affine/auth'; import { useCurrentLoginStatus } from '../hooks/affine/use-current-login-status'; interface LocationState { - state: { + state?: { callbackURL?: string; }; } @@ -40,7 +40,7 @@ export const Component = () => { console.error(err); }); }, [ - location.state.callbackURL, + location.state?.callbackURL, loginStatus, navigate, onceSignedIn,