Skip to content
Snippets Groups Projects
Commit cbb20b73 authored by Ramon Souza's avatar Ramon Souza
Browse files

resync breakout room timer

parent 7625910e
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment