anear-js-api 0.3.9 → 0.3.12
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.
|
@@ -98,7 +98,7 @@ class AnearMessaging {
|
|
|
98
98
|
const timer = this.participantTimers[participant.id] || this.createTimer(anearEvent, participant, timeoutMsecs)
|
|
99
99
|
|
|
100
100
|
if (timer.isPaused) {
|
|
101
|
-
|
|
101
|
+
timeRemaining = this.timeRemaining
|
|
102
102
|
timerStarter = () => timer.resume()
|
|
103
103
|
} else {
|
|
104
104
|
timerStarter = () => timer.start(timeoutMsecs)
|
|
@@ -129,14 +129,14 @@ class AnearMessaging {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
pauseParticipantTimer(participantId) {
|
|
132
|
-
const timer = this.participantTimers[
|
|
133
|
-
|
|
132
|
+
const timer = this.participantTimers[participantId]
|
|
133
|
+
|
|
134
134
|
if (timer && timer.isRunning) timer.pause()
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
resetParticipantTimer(participantId) {
|
|
138
138
|
// called after participant takes Action before timer expires
|
|
139
|
-
const timer = this.participantTimers[
|
|
139
|
+
const timer = this.participantTimers[participantId]
|
|
140
140
|
if (timer) timer.reset()
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -433,12 +433,11 @@ class AnearMessaging {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
async participantLeaveMessagingCallback(anearEvent, message) {
|
|
436
|
-
// this can be just a temporary leave (refresh browser for example), so
|
|
437
|
-
// for now
|
|
436
|
+
// this can be just a temporary leave (refresh browser for example), so pause any participant timers
|
|
438
437
|
const userId = message.clientId
|
|
439
|
-
const participantId = message.data.
|
|
438
|
+
const participantId = message.data.id
|
|
440
439
|
|
|
441
|
-
logger.debug(`**** LEAVE PARTICIPANT **** participantLeaveMessagingCallback(
|
|
440
|
+
logger.debug(`**** LEAVE PARTICIPANT **** participantLeaveMessagingCallback(participant: ${participantId})`)
|
|
442
441
|
|
|
443
442
|
// pause the participant timer if one was active. The participant may return shortly
|
|
444
443
|
// and we can resume this timer
|