Skip to content

Commit 743ffa8

Browse files
authored
Merge pull request #1363 from mzedel/fix/livechat-errors-in-dev
made the inclusion of the livechat depend on the environment the bundle was created for
2 parents 1067550 + 692fbc4 commit 743ffa8

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/js/components/app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ export const AppRoot = ({
9494
{onboardingComponent ? onboardingComponent : null}
9595
{showDismissHelptipsDialog && <ConfirmDismissHelptips />}
9696
{showDeviceConnectionDialog && <DeviceConnectionDialog onCancel={() => setShowConnectingDialog(false)} />}
97-
<LiveChatBox />
97+
{
98+
// eslint-disable-next-line no-undef
99+
ENV === 'production' && <LiveChatBox />
100+
}
98101
</>
99102
) : (
100103
publicRoutes

tests/setupTests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ beforeAll(async () => {
5555
setItem: jest.fn(),
5656
removeItem: jest.fn()
5757
};
58+
window.ENV = 'test';
5859
server = setupServer(...handlers);
5960
await server.listen();
6061
Object.defineProperty(navigator, 'appVersion', { value: 'Test', writable: true });

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module.exports = (env, argv) => ({
9797
Buffer: ['buffer', 'Buffer']
9898
}),
9999
new webpack.DefinePlugin({
100+
ENV: JSON.stringify(argv.mode),
100101
XTERM_VERSION: JSON.stringify(require('./package.json').dependencies.xterm),
101102
XTERM_FIT_VERSION: JSON.stringify(require('./package.json').dependencies['xterm-addon-fit']),
102103
XTERM_SEARCH_VERSION: JSON.stringify(require('./package.json').dependencies['xterm-addon-search'])

0 commit comments

Comments
 (0)