Merge pull request #11510 from ramonlsouza/issue-11358
Fix breakout room timer sync
This commit is contained in:
commit
2856075bc2
@ -34,6 +34,8 @@ const intlMessages = defineMessages({
|
||||
});
|
||||
|
||||
let timeRemaining = 0;
|
||||
let prevTimeRemaining = 0;
|
||||
|
||||
const timeRemainingDep = new Tracker.Dependency();
|
||||
let timeRemainingInterval = null;
|
||||
|
||||
@ -89,8 +91,12 @@ export default injectNotify(injectIntl(withTracker(({
|
||||
const data = {};
|
||||
if (breakoutRoom) {
|
||||
const roomRemainingTime = breakoutRoom.timeRemaining;
|
||||
const localRemainingTime = getTimeRemaining();
|
||||
const shouldResync = prevTimeRemaining !== roomRemainingTime && roomRemainingTime !== localRemainingTime;
|
||||
|
||||
if ((!timeRemainingInterval || shouldResync) && roomRemainingTime) {
|
||||
prevTimeRemaining = roomRemainingTime;
|
||||
|
||||
if (!timeRemainingInterval && roomRemainingTime) {
|
||||
timeRemainingInterval = startCounter(
|
||||
roomRemainingTime,
|
||||
setTimeRemaining,
|
||||
|
Loading…
Reference in New Issue
Block a user