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

Commit fbbc5ec

Browse files
authored
Merge pull request #231 from albertmourato/fix-data-callback
Fix data parameter always undefined on callback for track method
2 parents 1cc1e2e + b7f7b02 commit fbbc5ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,16 @@ class Analytics {
205205

206206
if (!this.flushed) {
207207
this.flushed = true
208-
this.flush()
208+
this.flush(callback)
209209
return
210210
}
211211

212212
if (this.queue.length >= this.flushAt) {
213-
this.flush()
213+
this.flush(callback)
214214
}
215215

216216
if (this.flushInterval && !this.timer) {
217-
this.timer = setTimeout(this.flush.bind(this), this.flushInterval)
217+
this.timer = setTimeout(this.flush.bind(this, callback), this.flushInterval)
218218
}
219219
}
220220

0 commit comments

Comments
 (0)