anear-js-api 0.4.15 → 0.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -305,6 +305,11 @@ class AnearEvent extends JsonApiResource {
305
305
  this.participants.resetAllTimers()
306
306
  }
307
307
 
308
+ destroyParticipantTimers() {
309
+ // turns off any active and removes all other AnearParticipant timer
310
+ this.participants.destroyAllTimers()
311
+ }
312
+
308
313
  eventChannelName () {
309
314
  return this.getChannelName('event')
310
315
  }
@@ -114,6 +114,7 @@ class Participants {
114
114
  if (participant.state === ActiveState) {
115
115
  if (this.isIdle(participant, currentTimestamp)) {
116
116
  participant.state = IdleState
117
+ participant.destroyTimer()
117
118
  }
118
119
  } else if (participant.state === IdleState) {
119
120
  if (this.isPurge(participant, currentTimestamp)) {
@@ -162,9 +163,13 @@ class Participants {
162
163
 
163
164
  resetAllTimers() {
164
165
  this.active.forEach(
165
- p => {
166
- p.resetTimer()
167
- }
166
+ p => p.resetTimer()
167
+ )
168
+ }
169
+
170
+ destroyAllTimers() {
171
+ this.active.forEach(
172
+ p => p.destroyTimer()
168
173
  )
169
174
  }
170
175
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anear-js-api",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "description": "Javascript Developer API for Anear Apps",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {