Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
- Previously, on successful forfeit call, we still set
a new entry in the yjs doc. This causes the yjs doc
to be reintialise when both users has already forfeited
  • Loading branch information
limcaaarl committed Nov 12, 2024
1 parent c49d008 commit 97a786e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export class ForfeitDialogComponent implements OnInit {
if (userId) {
this.collabService.forfeit(this.roomId).subscribe({
next: () => {
this.yforfeit.set(userId, true);
if (this.yforfeit.size == 0) {
this.yforfeit.set(userId, true);
}
this.message = 'You have forfeited. \n\n Redirecting you to homepage...';
this.isForfeit = true;
this.hideButtons = true;
Expand Down

0 comments on commit 97a786e

Please sign in to comment.