Skip to content

Commit 14b2e3c

Browse files
committed
fixed race condition with overview render loop
1 parent 4c2909c commit 14b2e3c

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

public/crucial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const configurations = {
2222
};
2323

2424
const configuration = "public";
25-
const version = "1.6.61"; // Big Update . Small Feature Release . Bug Fix
25+
const version = "1.6.62"; // Big Update . Small Feature Release . Bug Fix
2626
const domain = "markifyapp.com";
2727

2828
let config = configurations[configuration];

public/modules/breakout/group.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -736,13 +736,21 @@ modules["breakout/group"] = class {
736736
}
737737
}, { sort: 1 });
738738

739+
let promptWelcomeModal = async () => {
740+
if (this.welcomeRead != true && this.parent.parent.self.access < 4 && Object.keys(this.members).length > 1) {
741+
this.welcomeRead = true;
742+
frame.insertAdjacentHTML("beforeend", `<div class="boCreateBreakoutHolder"></div>`);
743+
this.welcomeModal = await modalModule.open("modals/lesson/breakout/group/welcome", frame.querySelector(".boCreateBreakoutHolder"), null, "Your Team", null, { parent: this });
744+
}
745+
}
739746
this.pipeline.subscribe("memberAssign", "memberassign", (data) => {
740747
this.parent.parent.collaborators[data.collaborator._id] = data.collaborator;
741748
let groupMember = this.members[data.collaborator._id];
742749
if (data.group == this.group._id) {
743750
if (groupMember == null) {
744751
this.members[data.collaborator._id] = [];
745752
}
753+
promptWelcomeModal();
746754
} else if (groupMember != null) {
747755
if (this.editor.realtime.module != null) {
748756
for (let i = 0; i < groupMember.length; i++) {
@@ -754,6 +762,7 @@ modules["breakout/group"] = class {
754762
this.updateMemberCount();
755763
}
756764
}, { sort: 1 });
765+
promptWelcomeModal();
757766

758767
// Fetch Annotations:
759768
let pageParam = getParam("page");
@@ -797,11 +806,6 @@ modules["breakout/group"] = class {
797806

798807
modifyParams("team", this.group._id);
799808

800-
if (this.welcomeRead != true && this.parent.parent.self.access < 4) { // && Object.keys(this.members).length > 1
801-
frame.insertAdjacentHTML("beforeend", `<div class="boCreateBreakoutHolder"></div>`);
802-
this.welcomeModal = await modalModule.open("modals/lesson/breakout/group/welcome", frame.querySelector(".boCreateBreakoutHolder"), null, "Your Team", null, { parent: this });
803-
}
804-
805809
this.updateInterface();
806810
}
807811
}

public/modules/breakout/overview.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ modules["breakout/overview"] = class {
890890
}
891891
this.layout.runUpdateCycle = async () => {
892892
if (this.layout.runningUpdateCycle == true) {
893+
this.layout.reRunUpdateCycle = true;
893894
return;
894895
}
895896
this.layout.runningUpdateCycle = true;
@@ -1152,6 +1153,10 @@ modules["breakout/overview"] = class {
11521153
this.lastResizeWasSimulated = false;
11531154

11541155
this.layout.runningUpdateCycle = false;
1156+
if (this.layout.reRunUpdateCycle == true) {
1157+
this.layout.reRunUpdateCycle = false;
1158+
this.layout.runUpdateCycle();
1159+
}
11551160
}
11561161
this.layout.refreshTotalColumnHeight = () => {
11571162
this.layout.longestColumn = this.layout.getSectionTop();
@@ -1499,7 +1504,7 @@ modules["breakout/overview"] = class {
14991504
groupTile.members.splice(index, 1);
15001505
}
15011506
}
1502-
this.layout.removeMemberTile(data.modify);
1507+
this.layout.removeMemberTile(data.modify, true);
15031508
}
15041509
}
15051510
this.layout.members[data.modify] = { ...(existingMember ?? {}), group: data.group, modify: data.modify };
@@ -1541,7 +1546,7 @@ modules["breakout/overview"] = class {
15411546
} else if (data.group != null) {
15421547
updateUnassignedMemberCount(-1);
15431548
}
1544-
this.layout.removeMemberTile(modify);
1549+
this.layout.removeMemberTile(modify, true);
15451550
groupMember.group = data.group;
15461551
if (data.group != null) {
15471552
let groupTile = this.layout.tiles[data.group];
@@ -1556,10 +1561,10 @@ modules["breakout/overview"] = class {
15561561
}
15571562
} else if (groupTile.members != null && groupTile.members.includes(modify) == false) {
15581563
groupTile.members.push(modify);
1559-
this.layout.addMemberTile(modify);
1564+
this.layout.addMemberTile(modify, true);
15601565
}
15611566
} else if ((this.layout.memberSessions[modify] ?? []).length > 0) {
1562-
this.layout.addMemberTile(modify);
1567+
this.layout.addMemberTile(modify, true);
15631568
updateUnassignedMemberCount(1);
15641569
}
15651570
}
@@ -1596,7 +1601,7 @@ modules["breakout/overview"] = class {
15961601
if (data.member.group != null) {
15971602
this.layout.updateMemberTile(this.parent.parent.collaborators[data.member.modify]);
15981603
} else {
1599-
this.layout.removeMemberTile(data.member.modify);
1604+
this.layout.removeMemberTile(data.member.modify, true);
16001605
updateUnassignedMemberCount(-1);
16011606
}
16021607
}

0 commit comments

Comments
 (0)