Merge pull request #11510 from ramonlsouza/issue-11358

Fix breakout room timer sync
This commit is contained in:
Anton Georgiev 2021-02-26 11:45:58 -05:00 committed by GitHub
commit 2856075bc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,