Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrisha-rudder committed Feb 20, 2020
1 parent 759ae9a commit b049b83
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 181 deletions.
6 changes: 5 additions & 1 deletion analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ class Analytics {
*/
group(groupId, traits, options, callback) {

if (!arguments.length) return;

if (typeof options == "function") (callback = options), (options = null);
if (typeof traits == "function") (callback = traits), (options = null), (traits = null);
if (typeof groupId == "object") (options = traits), (traits = groupId), (groupId = this.groupId);
Expand All @@ -344,8 +346,10 @@ class Analytics {
for (let key in traits) {
this.groupTraits[key] = traits[key];
}
this.storage.setGroupTraits(this.groupTraits);
} else {
this.groupTraits = {}
}
this.storage.setGroupTraits(this.groupTraits);

this.processAndSendDataToDestinations(
"group",
Expand Down

0 comments on commit b049b83

Please sign in to comment.