Skip to content

Commit

Permalink
fix(whiteboard): style error of the smallClassPage when join room (#1076
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Cheerego7 committed Nov 8, 2021
1 parent 94c3b84 commit 933a7e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion desktop/renderer-app/src/stores/class-room-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class ClassRoomStore {

this.whiteboardStore = new WhiteboardStore({
isCreator: this.isCreator,
roomType: this.roomInfo?.roomType || RoomType.BigClass,
getRoomType: () => this.roomInfo?.roomType || RoomType.BigClass,
});

this.shareScreenStore = new ShareScreenStore(this.roomUUID);
Expand Down
8 changes: 4 additions & 4 deletions desktop/renderer-app/src/stores/whiteboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export class WhiteboardStore {

/** is room Creator */
public readonly isCreator: boolean;
public readonly roomType: RoomType;
public readonly getRoomType: () => RoomType;

public constructor(config: { isCreator: boolean; roomType: RoomType }) {
public constructor(config: { isCreator: boolean; getRoomType: () => RoomType }) {
this.isCreator = config.isCreator;
this.isWritable = config.isCreator;
this.roomType = config.roomType;
this.getRoomType = config.getRoomType;

makeAutoObservable<this, "preloadPPTResource">(this, {
room: observable.ref,
Expand Down Expand Up @@ -101,7 +101,7 @@ export class WhiteboardStore {

public getWhiteboardRatio = (): number => {
// the Ratio of whiteboard compute method is height / width.
if (this.roomType === RoomType.SmallClass) {
if (this.getRoomType() === RoomType.SmallClass) {
return this.smallClassRatio;
}
return this.otherClassRatio;
Expand Down
7 changes: 1 addition & 6 deletions web/flat-web/src/stores/whiteboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@ export class WhiteboardStore {
/** is room Creator */
public readonly isCreator: boolean;
public readonly getRoomType: () => RoomType;
public readonly isSpeaker?: boolean;

public constructor(config: {
isCreator: boolean;
isSpeaker?: boolean;
getRoomType: () => RoomType;
}) {
public constructor(config: { isCreator: boolean; getRoomType: () => RoomType }) {
this.isCreator = config.isCreator;
this.isWritable = config.isCreator;
this.getRoomType = config.getRoomType;
Expand Down

0 comments on commit 933a7e5

Please sign in to comment.