Put connect defaults into the state
This commit is contained in:
parent
ff7c563b61
commit
d3a0a21338
@ -57,7 +57,7 @@ class Connect extends PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const defaults = window.ENV.defaults;
|
||||
const { defaults } = this.props;
|
||||
let optionals = null;
|
||||
|
||||
if (this.state.showOptionals) {
|
||||
@ -102,4 +102,10 @@ class Connect extends PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
export default connect()(Connect);
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
defaults: state.environment.get('connect_defaults')
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(Connect);
|
||||
|
@ -9,6 +9,7 @@ import routes from './routes';
|
||||
import Socket from './util/Socket';
|
||||
import handleSocket from './socket';
|
||||
import Root from './containers/Root';
|
||||
import { setEnvironment } from './actions/environment';
|
||||
import { addMessages } from './actions/message';
|
||||
import { initWidthUpdates } from './util/messageHeight';
|
||||
|
||||
@ -21,10 +22,7 @@ handleSocket(socket, store);
|
||||
|
||||
const env = JSON.parse(document.getElementById('env').innerHTML);
|
||||
|
||||
// TODO: Handle this properly
|
||||
window.ENV = {
|
||||
defaults: env.defaults
|
||||
};
|
||||
store.dispatch(setEnvironment('connect_defaults', env.defaults));
|
||||
|
||||
if (env.servers) {
|
||||
store.dispatch({
|
||||
|
Loading…
Reference in New Issue
Block a user