Skip to content

Commit

Permalink
Fix a bug in INTERCOM browser.js (#572)
Browse files Browse the repository at this point in the history
* Fix a bug in INTERCOM browser.js

This boolean evaluation creates an absurd scenario where the intercom companies array is sent completely empty:
"companies":[{}]
Fixing this boolean evaluation solves the issue and populates the company correctly.

* Update browser.js

Co-authored-by: shrouti1507 <[email protected]>
  • Loading branch information
ariel-talent-fabric and shrouti1507 authored Jul 27, 2022
1 parent a355a3e commit e6ba154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integrations/INTERCOM/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class INTERCOM {
Object.keys(context.traits[field])) ||
[];
companyFields.forEach((key) => {
if (companyFields.hasOwnProperty(key)) {
if (companyFields.includes(key)) {
if (key != "id") {
company[key] = context.traits[field][key];
} else {
Expand Down

0 comments on commit e6ba154

Please sign in to comment.