anear-js-api 0.4.13 → 0.4.15

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.
@@ -376,7 +376,8 @@ class AnearMessaging {
376
376
  // closes out a single Participant. This is invoked when a single
377
377
  // participant leaves an event, and the event may possibly continue,
378
378
  // or possibly exit. Or this may be called by the event when exiting
379
- // and cleaning out any remaining participants.
379
+ // and cleaning out any remaining participants. Note: The participant
380
+ // can will no longer be able to have their display updated
380
381
  logger.debug(`closeParticipant(${participantId})`)
381
382
 
382
383
  const participant = anearEvent.participants.getById(participantId)
@@ -68,7 +68,7 @@ class AnearEvent extends JsonApiResource {
68
68
  const clonedFromEventData = this.relationships["cloned-from"].data
69
69
  if (!clonedFromEventData) return null
70
70
 
71
- return this.constructor.getFromStorage(clonedEventData.id)
71
+ return this.constructor.getFromStorage(clonedFromEventData.id)
72
72
  }
73
73
 
74
74
  async clonedFromEventContext() {
@@ -271,7 +271,9 @@ class AnearEvent extends JsonApiResource {
271
271
  }
272
272
 
273
273
  closeOutParticipants() {
274
+ // returns a Promise
274
275
  // upon exiting the event, this will clean up any participants remaining
276
+ // by closing out their messaging channels and purging them
275
277
  return Promise.all(
276
278
  this.participants.all.map(
277
279
  p => {
@@ -288,6 +290,7 @@ class AnearEvent extends JsonApiResource {
288
290
  }
289
291
 
290
292
  purgeParticipants() {
293
+ // returns a Promise
291
294
  // remove participants and host from Participants class and from Storage
292
295
  const all = this.participants.all
293
296
  if (this.participants.host) all.push(this.participants.host)
@@ -297,6 +300,11 @@ class AnearEvent extends JsonApiResource {
297
300
  )
298
301
  }
299
302
 
303
+ resetParticipantTimers() {
304
+ // turns off any active AnearParticipant timer
305
+ this.participants.resetAllTimers()
306
+ }
307
+
300
308
  eventChannelName () {
301
309
  return this.getChannelName('event')
302
310
  }
@@ -160,6 +160,14 @@ class Participants {
160
160
  }
161
161
  }
162
162
 
163
+ resetAllTimers() {
164
+ this.active.forEach(
165
+ p => {
166
+ p.resetTimer()
167
+ }
168
+ )
169
+ }
170
+
163
171
  get currentTimestamp() {
164
172
  return new Date().getTime()
165
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anear-js-api",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "Javascript Developer API for Anear Apps",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {