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

This commit is contained in:
LongYinan
2023-09-05 12:21:28 -07:00
committed by GitHub
parent ff808881ee
commit 6af7aefe00
+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,