Skip to content

Commit db3c756

Browse files
committed
Add build-time environment variable for enabling windchimes
Disabled by default for development where those requests get blocked by CORS and are just noise.
1 parent 998d087 commit db3c756

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/containers/tw-windchime-submitter.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const OPT_OUT_KEY = 'tw:windchime_opt_out';
88
const submittedThisSession = new Set();
99

1010
const isOptedOut = () => {
11+
if (!process.env.ENABLE_WINDCHIMES) {
12+
return true;
13+
}
14+
1115
try {
1216
const local = localStorage.getItem(OPT_OUT_KEY);
1317
if (local !== null) {

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ module.exports = [
179179
'process.env.DEBUG': Boolean(process.env.DEBUG),
180180
'process.env.ENABLE_SERVICE_WORKER': JSON.stringify(process.env.ENABLE_SERVICE_WORKER || ''),
181181
'process.env.ROOT': JSON.stringify(root),
182-
'process.env.ROUTING_STYLE': JSON.stringify(process.env.ROUTING_STYLE || 'filehash')
182+
'process.env.ROUTING_STYLE': JSON.stringify(process.env.ROUTING_STYLE || 'filehash'),
183+
'process.env.ENABLE_WINDCHIMES': JSON.stringify(process.env.ENABLE_WINDCHIMES || '')
183184
}),
184185
new HtmlWebpackPlugin({
185186
chunks: ['editor'],

0 commit comments

Comments
 (0)