Skip to content

Commit

Permalink
Fix girder login when using the client from the dev stack
Browse files Browse the repository at this point in the history
  • Loading branch information
alesgenova committed Dec 4, 2019
1 parent 14e65a8 commit 11d76a5
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import React, {Component} from 'react';
import { ConnectedRouter } from 'connected-react-router';
import { Switch } from 'react-router'
import { connect } from 'react-redux';

import { isNil } from 'lodash-es';

import MoleculeContainer from './containers/molecule';
import CalculationContainer from './containers/calculation';
import {VibrationalModesChartContainer, FreeEnergyChartContainer} from './containers/charts';

import { selectors } from '@openchemistry/redux';
import { auth as authUI, route } from '@openchemistry/girder-ui';

// @material-ui components
Expand Down Expand Up @@ -71,10 +75,11 @@ class App extends Component {
}

render() {
const {classes} = this.props;
const {site, classes} = this.props;

let development = false;
if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development' ||
process.env.REACT_APP_DEPLOYMENT === 'development') {
site === 'development') {
development = true;
}

Expand Down Expand Up @@ -154,4 +159,20 @@ class App extends Component {
}
}

function mapStateToProps(state, _ownProps) {

const props = {
site: ''
};

const config = selectors.configuration.getConfiguration(state);
if (!isNil(config) && !isNil(config.deployment)) {
props.site = config.deployment.site;
}

return props;
}

App = connect(mapStateToProps)(App)

export default withStyles(appStyles)(App);

0 comments on commit 11d76a5

Please sign in to comment.