Skip to content

Commit 422fe98

Browse files
authored
Update push.js
1 parent 474dfff commit 422fe98

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/push.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function Push(options) {
1515

1616
Push.prototype.checkoutPing = function() {
1717
var _this = this;
18-
setTimeout(function () {
18+
_this.checkoutPingTimer && clearTimeout(_this.checkoutPingTimer);
19+
_this.checkoutPingTimer = setTimeout(function () {
20+
_this.checkoutPingTimer = 0;
1921
if (_this.connection.state === 'connected') {
2022
_this.connection.send('{"event":"pusher:ping","data":{}}');
2123
if (_this.pingTimeoutTimer) {
@@ -741,4 +743,4 @@ function formatParams(data){
741743
arr.push(encodeURIComponent(name)+'='+encodeURIComponent(data[name]));
742744
}
743745
return arr.join('&');
744-
}
746+
}

0 commit comments

Comments
 (0)