var React = require('react'),
    ReactRedux = require('react-redux'),
    api = require('./../steemAPI'),
    actions = require('../actions'),
    Sidebar = require('./../containers/sidebar');

var Wrapper = React.createClass({
  componentWillMount: function(){
    this.props.getConfig();
    this.props.login();
  },
  componentDidMount: function(){
    setInterval(function() {
      api.getDynamicGlobalProperties(function(err, result) {});
    }, 10000);
  },
  render: function() {
      var className = (!this.props.app.sidebarIsVisible)? 'app-wrapper full-width' : 'app-wrapper';
      return (
        <div className={className}>
          {this.props.app.sidebarIsVisible && <Sidebar />}
          {this.props.children}
        </div>
      );
  }
});

var mapStateToProps = function(state){
  return {
    app: state.app
  };
};

var mapDispatchToProps = function(dispatch){
  return {
    login: function(){ dispatch(actions.login()); },
    getConfig: function(){ dispatch(actions.getConfig()); }
  }
};

module.exports = ReactRedux.connect(mapStateToProps,mapDispatchToProps)(Wrapper);

@@ -313,16 +313,17 @@
 );%0A  %7D,%0A
+%0A
   compon
@@ -350,16 +350,37 @@
 n()%7B%0A   
+ this.steemInterval =
  setInte
@@ -476,21 +476,133 @@
 10000);%0A
-
   %7D,%0A
+%0A  componentWillUnmount() %7B%0A    if(window.clearInterval) %7B%0A      clearInterval(this.steemInterval);%0A    %7D%0A  %7D,%0A%0A
   render

clear interval in wrapper to prevent memory leaks