From 010156ef2c2c6977b9ad67fc613b369d8b3ae94f Mon Sep 17 00:00:00 2001 From: Eric Biagiotti Date: Tue, 21 May 2019 16:37:12 -0400 Subject: [PATCH] 15088: Fixes page refresh on link accounts page - Makes the link accounts page to not show text if data is being processed Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti --- src/store/auth/auth-action.ts | 10 +++++++++- .../link-account-panel/link-account-panel-root.tsx | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts index 5317ede4..be6e9f48 100644 --- a/src/store/auth/auth-action.ts +++ b/src/store/auth/auth-action.ts @@ -55,9 +55,17 @@ export const initAuth = (config: Config) => (dispatch: Dispatch, getState: () => // just logged in or there has been a successful link operation const data = services.linkAccountService.getLinkOpStatus(); if (!matchTokenRoute(location.pathname) && (!matchFedTokenRoute(location.pathname)) && data === undefined) { - dispatch(cancelLinking()); + dispatch(cancelLinking()).then(() => { + dispatch(init(config)); + }); + } + else { + dispatch(init(config)); } +}; + +const init = (config: Config) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const user = services.authService.getUser(); const token = services.authService.getApiToken(); const homeCluster = services.authService.getHomeCluster(); diff --git a/src/views/link-account-panel/link-account-panel-root.tsx b/src/views/link-account-panel/link-account-panel-root.tsx index 11159e9a..c38cbe64 100644 --- a/src/views/link-account-panel/link-account-panel-root.tsx +++ b/src/views/link-account-panel/link-account-panel-root.tsx @@ -80,7 +80,7 @@ export const LinkAccountPanelRoot = withStyles(styles) ( } - { status === LinkAccountPanelStatus.INITIAL && targetUser &&
+ { !isProcessing && status === LinkAccountPanelStatus.INITIAL && targetUser &&
{ isLocalUser(targetUser.uuid, localCluster) ? @@ -139,7 +139,7 @@ export const LinkAccountPanelRoot = withStyles(styles) ( }
} - { (status === LinkAccountPanelStatus.LINKING || status === LinkAccountPanelStatus.ERROR) && userToLink && targetUser && + { !isProcessing && (status === LinkAccountPanelStatus.LINKING || status === LinkAccountPanelStatus.ERROR) && userToLink && targetUser && { status === LinkAccountPanelStatus.LINKING && -- 2.30.2