Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #231 from albertmourato/fix-data-callback
Browse files Browse the repository at this point in the history
Fix data parameter always undefined on callback for track method
  • Loading branch information
pooyaj committed Feb 17, 2021
2 parents 1cc1e2e + b7f7b02 commit fbbc5ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -205,16 +205,16 @@ class Analytics {

if (!this.flushed) {
this.flushed = true
this.flush()
this.flush(callback)
return
}

if (this.queue.length >= this.flushAt) {
this.flush()
this.flush(callback)
}

if (this.flushInterval && !this.timer) {
this.timer = setTimeout(this.flush.bind(this), this.flushInterval)
this.timer = setTimeout(this.flush.bind(this, callback), this.flushInterval)
}
}

Expand Down

0 comments on commit fbbc5ec

Please sign in to comment.