15530: Don't offer to link remote account if LoginCluster is true.
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 7 Oct 2019 20:15:52 +0000 (16:15 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 7 Oct 2019 20:15:52 +0000 (16:15 -0400)
src/views/link-account-panel/link-account-panel.tsx

index c3ad51cf61bfa94251f2641a6331afcc09a48e5d..f0a9e5a1895e14782b68ad3135d10f7fb6ffae00 100644 (file)
@@ -16,7 +16,7 @@ import {
 const mapStateToProps = (state: RootState): LinkAccountPanelRootDataProps => {
     return {
         remoteHosts: state.auth.remoteHosts,
-        hasRemoteHosts: Object.keys(state.auth.remoteHosts).length > 1,
+        hasRemoteHosts: Object.keys(state.auth.remoteHosts).length > 1 && state.auth.loginCluster === "",
         selectedCluster: state.linkAccountPanel.selectedCluster,
         localCluster: state.auth.localCluster,
         targetUser: state.linkAccountPanel.targetUser,
@@ -31,7 +31,7 @@ const mapDispatchToProps = (dispatch: Dispatch): LinkAccountPanelRootActionProps
     startLinking: (type: LinkAccountType) => dispatch<any>(startLinking(type)),
     cancelLinking: () => dispatch<any>(cancelLinking(true)),
     linkAccount: () => dispatch<any>(linkAccount()),
-    setSelectedCluster: (selectedCluster: string) => dispatch<any>(linkAccountPanelActions.SET_SELECTED_CLUSTER({selectedCluster}))
+    setSelectedCluster: (selectedCluster: string) => dispatch<any>(linkAccountPanelActions.SET_SELECTED_CLUSTER({ selectedCluster }))
 });
 
 export const LinkAccountPanel = connect(mapStateToProps, mapDispatchToProps)(LinkAccountPanelRoot);