Skip to content

Commit

Permalink
chore(classroom): disable device state after off stage
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Aug 22, 2022
1 parent 13d45d8 commit eeeebd3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/flat-stores/src/classroom-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export class ClassroomStore {
// promises.push(this.stopRecording());

this.deviceStateStorage = undefined;
this.onStageUsersStorage = undefined;
this.classroomStorage = undefined;
}

Expand Down Expand Up @@ -538,18 +539,21 @@ export class ClassroomStore {
if (
this.classMode === ClassModeType.Interaction ||
userUUID === this.ownerUUID ||
!this.whiteboardStore.isWritable
!this.onStageUsersStorage?.isWritable
) {
return;
}
if (this.isCreator) {
this.onStageUsersStorage?.setState({ [userUUID]: onStage });
this.onStageUsersStorage.setState({ [userUUID]: onStage });
} else {
// joiner can only turn off speaking
if (!onStage && userUUID === this.userUUID) {
this.onStageUsersStorage?.setState({ [userUUID]: false });
this.onStageUsersStorage.setState({ [userUUID]: false });
}
}
if (!onStage) {
this.updateDeviceState(userUUID, false, false);
}
};

/** joiner updates own camera and mic state */
Expand Down

0 comments on commit eeeebd3

Please sign in to comment.