[ARVADOS-WORKBENCH2] updated: 2.1.0-137-gf3834ab9

Git user git at public.arvados.org
Fri Jan 8 21:00:15 UTC 2021


Summary of changes:
 src/views-components/api-token/api-token.tsx | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

       via  f3834ab9fef93773ad3f2063b38468b2fed51325 (commit)
      from  685165ce25015be034d92456513785abe03e9ba0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f3834ab9fef93773ad3f2063b38468b2fed51325
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date:   Fri Jan 8 21:59:27 2021 +0100

    17231: Added timeout to allow app to load properly before redirect
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>01~

diff --git a/src/views-components/api-token/api-token.tsx b/src/views-components/api-token/api-token.tsx
index b2823118..548dfe77 100644
--- a/src/views-components/api-token/api-token.tsx
+++ b/src/views-components/api-token/api-token.tsx
@@ -11,6 +11,7 @@ import { AuthService } from "~/services/auth-service/auth-service";
 import { navigateToRootProject, navigateToLinkAccount } from "~/store/navigation/navigation-action";
 import { Config } from "~/common/config";
 import { getAccountLinkData } from "~/store/link-account-panel/link-account-panel-actions";
+import { replace } from "react-router-redux";
 
 interface ApiTokenProps {
     authService: AuthService;
@@ -27,18 +28,20 @@ export const ApiToken = connect()(
             this.props.dispatch<any>(saveApiToken(apiToken)).finally(() => {
                 const redirectURL = this.props.authService.getTargetURL();
 
-                if (loadMainApp) {
-                    if (redirectURL) {
-                        this.props.authService.removeTargetURL();
-                        window.location.href = redirectURL;
+                setTimeout(() => {
+                    if (loadMainApp) {
+                        if (redirectURL) {
+                            this.props.authService.removeTargetURL();
+                            this.props.dispatch(replace(redirectURL));
+                        }
+                        else if (this.props.dispatch(getAccountLinkData())) {
+                            this.props.dispatch(navigateToLinkAccount);
+                        }
+                        else {
+                            this.props.dispatch(navigateToRootProject);
+                        }
                     }
-                    else if (this.props.dispatch(getAccountLinkData())) {
-                        this.props.dispatch(navigateToLinkAccount);
-                    }
-                    else {
-                        this.props.dispatch(navigateToRootProject);
-                    }
-                }
+                }, 0);
             });
         }
         render() {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list