From 3bc058f0bcd746912230e29683509d692fa8203e Mon Sep 17 00:00:00 2001 From: Eric Biagiotti Date: Wed, 15 May 2019 11:29:53 -0400 Subject: [PATCH] 15088: Fix to use new login function Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti --- .../link-account-panel/link-account-panel-actions.ts | 2 +- src/store/workbench/workbench-actions.ts | 5 ++--- src/views-components/api-token/api-token.tsx | 12 ++++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/store/link-account-panel/link-account-panel-actions.ts b/src/store/link-account-panel/link-account-panel-actions.ts index 55528824..e63da1a4 100644 --- a/src/store/link-account-panel/link-account-panel-actions.ts +++ b/src/store/link-account-panel/link-account-panel-actions.ts @@ -172,7 +172,7 @@ export const startLinking = (t: LinkAccountType) => services.linkAccountService.saveAccountToLink(accountToLink); const auth = getState().auth; dispatch(logout()); - dispatch(login(auth.localCluster, auth.remoteHosts[auth.homeCluster])); + dispatch(login(auth.localCluster, auth.homeCluster, auth.remoteHosts)); }; export const getAccountLinkData = () => diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 27ac76f3..9917782a 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -94,7 +94,6 @@ import { groupDetailsPanelColumns } from '~/views/group-details-panel/group-deta import { DataTableFetchMode } from "~/components/data-table/data-table"; import { loadPublicFavoritePanel, publicFavoritePanelActions } from '~/store/public-favorites-panel/public-favorites-action'; import { publicFavoritePanelColumns } from '~/views/public-favorites-panel/public-favorites-panel'; -import { USER_LINK_ACCOUNT_KEY } from '~/services/link-account-service/link-account-service'; import { loadCollectionsContentAddressPanel, collectionsContentAddressActions } from '~/store/collections-content-address-panel/collections-content-address-panel-actions'; import { collectionContentAddressPanelColumns } from '~/views/collection-content-address-panel/collection-content-address-panel'; @@ -117,7 +116,7 @@ const handleFirstTimeLoad = (action: any) => }; export const loadWorkbench = () => - async (dispatch: Dispatch, getState: () => RootState) => { + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { dispatch(progressIndicatorActions.START_WORKING(WORKBENCH_LOADING_SCREEN)); const { auth, router } = getState(); const { user } = auth; @@ -138,7 +137,7 @@ export const loadWorkbench = () => dispatch(apiClientAuthorizationsActions.SET_COLUMNS({ columns: apiClientAuthorizationPanelColumns })); dispatch(collectionsContentAddressActions.SET_COLUMNS({ columns: collectionContentAddressPanelColumns })); - if (sessionStorage.getItem(USER_LINK_ACCOUNT_KEY)) { + if (services.linkAccountService.getAccountToLink()) { dispatch(linkAccountPanelActions.HAS_SESSION_DATA()); } diff --git a/src/views-components/api-token/api-token.tsx b/src/views-components/api-token/api-token.tsx index 2f8d87e1..fae099d5 100644 --- a/src/views-components/api-token/api-token.tsx +++ b/src/views-components/api-token/api-token.tsx @@ -31,12 +31,12 @@ 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); - } + if (this.props.dispatch(getAccountLinkData())) { + this.props.dispatch(navigateToLinkAccount); + } + else { + this.props.dispatch(navigateToRootProject); + } } }); } -- 2.30.2