fix move scopesetup redirect

This commit is contained in:
nick-delirium 2024-09-03 13:54:06 +02:00
parent eb7f60c721
commit 2f1e9de6a0
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 10 additions and 6 deletions

View file

@ -170,15 +170,19 @@ const Router: React.FC<RouterProps> = (props) => {
useEffect(() => {
if (prevIsLoggedIn !== isLoggedIn && isLoggedIn) {
handleUserLogin();
if (scopeSetup) {
history.push(routes.scopeSetup())
} else if (spotCb) {
void handleUserLogin();
if (spotCb) {
history.push(spotsList())
localStorage.setItem(SPOT_ONBOARDING, 'true')
}
}
}, [isLoggedIn, scopeSetup]);
}, [isLoggedIn]);
useEffect(() => {
if (scopeSetup) {
history.push(routes.scopeSetup())
}
}, [scopeSetup])
useEffect(() => {
if (isLoggedIn && location.pathname.includes('login') && localSpotJwt) {

View file

@ -64,7 +64,7 @@ window.getJWT = () => {
}
}
window.setJWT = (jwt) => {
store.dispatch({ type: UPDATE_JWT, data: jwt })
store.dispatch({ type: UPDATE_JWT, data: { jwt } })
}
export default store;