File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,27 @@ export const useRedirectWithSession = () => {
2828 org ?. integrations ?. bitbucket ;
2929
3030 useEffect ( ( ) => {
31- if ( ! orgId ) return ;
31+ if ( ! orgId || ! router . isReady ) return ;
3232 if ( ! isOrgWelcomed ) {
3333 depFn ( router . replace , ROUTES . WELCOME . PATH ) ;
3434 return ;
3535 }
36- if ( ! isOneCodeProviderIntegrated || ! anyTeamEverExisted ) {
36+ if ( ! isOneCodeProviderIntegrated ) {
3737 depFn ( router . replace , ROUTES . INTEGRATIONS . PATH ) ;
3838 return ;
3939 }
40+ if ( ! anyTeamEverExisted ) {
41+ depFn ( router . replace , ROUTES . TEAMS . PATH ) ;
42+ return ;
43+ }
4044 depFn ( router . replace , defaultRoute . PATH ) ;
4145 } , [
4246 anyTeamEverExisted ,
4347 defaultRoute . PATH ,
4448 isOneCodeProviderIntegrated ,
4549 isOrgWelcomed ,
4650 orgId ,
51+ router . isReady ,
4752 router . replace
4853 ] ) ;
4954} ;
You can’t perform that action at this time.
0 commit comments