fix move scopesetup redirect
This commit is contained in:
parent
eb7f60c721
commit
2f1e9de6a0
2 changed files with 10 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue