Skip to content

Commit

Permalink
Build: Async Load Happy Chat, CSS Reload, Network detection (take 2) (#…
Browse files Browse the repository at this point in the history
…11868)

This reverts commit 1008869.
  • Loading branch information
blowery authored Mar 24, 2017
1 parent f84d5e0 commit 9887b64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/boot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ function reduxStoreReady( reduxStore ) {
}

if ( config.isEnabled( 'network-connection' ) ) {
require( 'lib/network-connection' ).init( reduxStore );
asyncRequire( 'lib/network-connection', netConn => netConn.init( reduxStore ) );
}

if ( config.isEnabled( 'css-hot-reload' ) ) {
require( 'lib/css-hot-reload' )();
asyncRequire( 'lib/css-hot-reload', cssHotReload => cssHotReload() );
}

// Render Layout only for non-isomorphic sections.
Expand Down
8 changes: 4 additions & 4 deletions client/layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var React = require( 'react' ),
/**
* Internal dependencies
*/
var MasterbarLoggedIn = require( 'layout/masterbar/logged-in' ),
var AsyncLoad = require( 'components/async-load' ),
MasterbarLoggedIn = require( 'layout/masterbar/logged-in' ),
MasterbarLoggedOut = require( 'layout/masterbar/logged-out' ),
observe = require( 'lib/mixins/data-observe' ),
GlobalNotices = require( 'components/global-notices' ),
Expand All @@ -29,8 +30,7 @@ var MasterbarLoggedIn = require( 'layout/masterbar/logged-in' ),
QueryPreferences = require( 'components/data/query-preferences' ),
KeyboardShortcutsMenu,
Layout,
SupportUser,
Happychat = require( 'components/happychat' );
SupportUser;

import { isOffline } from 'state/application/selectors';
import { hasSidebar } from 'state/ui/selectors';
Expand Down Expand Up @@ -171,7 +171,7 @@ Layout = React.createClass( {
isEnabled={ translator.isEnabled() }
isActive={ translator.isActivated() }/>
{ this.renderPreview() }
{ config.isEnabled( 'happychat' ) && this.props.chatIsOpen && <Happychat /> }
{ config.isEnabled( 'happychat' ) && this.props.chatIsOpen && <AsyncLoad require="components/happychat" /> }
</div>
);
}
Expand Down

0 comments on commit 9887b64

Please sign in to comment.