fix(core): location.state maybe null (#4203)

This commit is contained in:
LongYinan authored and GitHub committed 2023-09-05 19:21:28 +00:00
1 parent ff808881ee
commit 6af7aefe00
1 file changed
+4 -2
+4 -2
View File
@@ -29,14 +29,16 @@ export const Component = () => {
await onceSignedIn();
setAuthAtom(prev => ({ ...prev, onceSignedIn: undefined }));
}
if (location.state.callbackURL) {
if (location.state?.callbackURL) {
navigate(location.state.callbackURL, {
replace: true,
});
}
}
};
afterSignedIn();
afterSignedIn().catch(err => {
console.error(err);
});
}, [
location.state.callbackURL,
loginStatus,