Merge branch 'master' into 15088-merge-account
[arvados-workbench2.git] / src / views-components / api-token / api-token.tsx
index b78e7192dc0bd24f5c1ef14ed1ab6c0629aea564..2f8d87e1ede0d1b95fe688738583605136254904 100644 (file)
@@ -8,10 +8,11 @@ import { connect, DispatchProp } from "react-redux";
 import { authActions, getUserDetails, saveApiToken } from "~/store/auth/auth-action";
 import { getUrlParameter } from "~/common/url";
 import { AuthService } from "~/services/auth-service/auth-service";
-import { navigateToRootProject } from "~/store/navigation/navigation-action";
+import { navigateToRootProject, navigateToLinkAccount } from "~/store/navigation/navigation-action";
 import { User } from "~/models/user";
 import { Config } from "~/common/config";
 import { initSessions } from "~/store/auth/auth-action-session";
+import { getAccountLinkData } from "~/store/link-account-panel/link-account-panel-actions";
 
 interface ApiTokenProps {
     authService: AuthService;
@@ -30,8 +31,13 @@ export const ApiToken = connect()(
                 this.props.dispatch(initSessions(this.props.authService, this.props.config, user));
             }).finally(() => {
                 if (loadMainApp) {
+                if (this.props.dispatch(getAccountLinkData())) {
+                    this.props.dispatch(navigateToLinkAccount);
+                }
+                else {
                     this.props.dispatch(navigateToRootProject);
                 }
+                }
             });
         }
         render() {