Skip to content

Commit 4c916ba

Browse files
author
tosih
committed
Pass intercom app id in environment for Grunt build instead of hardcoded.
1 parent a915dde commit 4c916ba

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

Gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ module.exports = function(grunt) {
287287
var locals = {
288288
version: version,
289289
env: require('./client/config/json/environment.json').environment,
290+
intercom_app_id: process.env.INTERCOM_APP_ID || 'xs5g95pd',
290291
commitHash: require('./client/config/json/commit.json').commitHash,
291292
commitTime: require('./client/config/json/commit.json').commitTime,
292293
apiHost: require('./client/config/json/api.json').host

client/services/serviceEventTracking.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@ function EventTracking(
2525
$stateParams,
2626
$window,
2727
assign,
28-
keypather,
29-
configEnvironment
28+
keypather
3029
) {
31-
if (configEnvironment === 'production') {
32-
INTERCOM_APP_ID = 'wqzm3rju'; // production ID
33-
} else {
34-
INTERCOM_APP_ID = 'xs5g95pd'; // test ID
35-
}
30+
INTERCOM_APP_ID = process.env.INTERCOM_APP_ID || 'xs5g95pd';
3631
_keypather = keypather;
3732
_$location = $location;
3833

layout.jade

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ html(
204204
) Dismiss
205205

206206
//- Intercom
207-
if env === 'production'
208-
script(
209-
src = "https://widget.intercom.io/widget/wqzm3rju"
210-
)
211-
else
212-
script(
213-
src = "https://widget.intercom.io/widget/xs5g95pd"
214-
)
207+
script(
208+
src = "https://widget.intercom.io/widget/" + intercom_app_id
209+
)

0 commit comments

Comments
 (0)