Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(flat-stores): never delete owner info in classroom #1923

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/flat-stores/src/classroom-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export class ClassroomStore {

const fastboard = await this.whiteboardStore.joinWhiteboardRoom();

await this.users.initUsers([...this.rtm.members]);
await this.users.initUsers([this.ownerUUID, ...this.rtm.members]);

const deviceStateStorage = fastboard.syncedStore.connectStorage<DeviceStateStorageState>(
"deviceState",
Expand Down
5 changes: 3 additions & 2 deletions packages/flat-stores/src/user-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class UserStore {

public get totalUserCount(): number {
return (
(this.creator ? 1 : 0) +
(this.creator && !this.creator.hasLeft ? 1 : 0) +
(this.speakingJoiners.length +
this.handRaisingJoiners.length +
this.otherJoiners.length)
Expand Down Expand Up @@ -98,7 +98,8 @@ export class UserStore {
public removeUser = (userUUID: string): void => {
if (this.creator && this.creator.userUUID === userUUID) {
this.creator.hasLeft = true;
this.creator = null;
// always show creator
// this.creator = null;
} else {
for (const { group } of this.joinerGroups) {
for (let i = 0; i < this[group].length; i++) {
Expand Down