15069: Fix typechecking for skipValidation parameter of SearchBarValueField
[arvados.git] / src / views-components / api-token / api-token.tsx
index b78e7192dc0bd24f5c1ef14ed1ab6c0629aea564..0e90b720c378670e4c7291c8db04c9f59689f094 100644 (file)
@@ -5,13 +5,14 @@
 import { RouteProps } from "react-router";
 import * as React from "react";
 import { connect, DispatchProp } from "react-redux";
-import { authActions, getUserDetails, saveApiToken } from "~/store/auth/auth-action";
+import { 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,7 +31,12 @@ export const ApiToken = connect()(
                 this.props.dispatch(initSessions(this.props.authService, this.props.config, user));
             }).finally(() => {
                 if (loadMainApp) {
-                    this.props.dispatch(navigateToRootProject);
+                    if (this.props.dispatch(getAccountLinkData())) {
+                        this.props.dispatch(navigateToLinkAccount);
+                    }
+                    else {
+                        this.props.dispatch(navigateToRootProject);
+                    }
                 }
             });
         }