Use an empty queue if CES feature is not enabled (https://github.com/woocommerce/woocommerce-admin/pull/5800)

* Include CES component only if the feature flag is enabled
This commit is contained in:
Moon 2020-12-03 14:48:51 -08:00 committed by GitHub
parent 91bf42d7f4
commit 27a3884a94
1 changed files with 15 additions and 8 deletions

View File

@ -83,12 +83,19 @@ if ( navigationRoot ) {
render( <Navigation />, navigationRoot );
}
// Set up customer effort score survey.
( function () {
const root = appRoot || embeddedRoot;
// Render the CustomerEffortScoreTracksContainer only if
// the feature flag is enabled.
if (
window.wcAdminFeatures &&
window.wcAdminFeatures[ 'customer-effort-score-tracks' ] === true
) {
// Set up customer effort score survey.
( function () {
const root = appRoot || embeddedRoot;
render(
<CustomerEffortScoreTracksContainer />,
root.insertBefore( document.createElement( 'div' ), null )
);
} )();
render(
<CustomerEffortScoreTracksContainer />,
root.insertBefore( document.createElement( 'div' ), null )
);
} )();
}