Skip to content

Commit

Permalink
fix(whiteboard): the buttons at the bottom of the whiteboard error st…
Browse files Browse the repository at this point in the history
…yle (#1089)
  • Loading branch information
Cheerego7 committed Nov 12, 2021
1 parent 0c2abed commit 885d936
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion desktop/renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@netless/redo-undo": "^0.0.5",
"@netless/tool-box": "^0.1.6",
"@netless/video-js-plugin": "^0.3.6",
"@netless/window-manager": "^0.2.17",
"@netless/window-manager": "^0.2.19-canary.0",
"@videojs/vhs-utils": "^2.3.0",
"agora-rtm-sdk": "^1.4.3",
"antd": "^4.15.4",
Expand Down
4 changes: 4 additions & 0 deletions desktop/renderer-app/src/components/Whiteboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const Whiteboard = observer<WhiteboardProps>(function Whiteboard({ whiteb
},
chessboard: false,
});

whiteboardStore.updateWindowMaximization(
Boolean(whiteboardStore.windowManager?.boxState === "maximized"),
);
whiteboardStore.onMainViewModeChange();
whiteboardStore.onWindowManagerBoxStateChange();
}
Expand Down
12 changes: 6 additions & 6 deletions desktop/renderer-app/src/stores/whiteboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,26 @@ export class WhiteboardStore {
}
};

public addMainViewScene = (): void => {
public addMainViewScene = async (): Promise<void> => {
if (this.room && this.windowManager) {
const currentScene = this.currentSceneIndex + 1;
const scenePath = this.room.state.sceneState.scenePath;
const path = this.dirName(scenePath);

this.room.putScenes(path, [{}], currentScene);
this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
await this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
}
};

public preMainViewScene = (): void => {
public preMainViewScene = async (): Promise<void> => {
if (this.windowManager && this.currentSceneIndex > 0) {
this.windowManager.setMainViewSceneIndex(this.currentSceneIndex - 1);
await this.windowManager.setMainViewSceneIndex(this.currentSceneIndex - 1);
}
};

public nextMainViewScene = (): void => {
public nextMainViewScene = async (): Promise<void> => {
if (this.windowManager && this.currentSceneIndex < this.scenesCount - 1) {
this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
await this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
}
};

Expand Down
2 changes: 1 addition & 1 deletion web/flat-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@netless/redo-undo": "^0.0.5",
"@netless/tool-box": "^0.1.6",
"@netless/video-js-plugin": "^0.3.6",
"@netless/window-manager": "^0.2.17",
"@netless/window-manager": "^0.2.19-canary.0",
"@videojs/vhs-utils": "^2.3.0",
"@zip.js/zip.js": "^2.3.7",
"agora-rtc-sdk-ng": "^4.5.0",
Expand Down
3 changes: 3 additions & 0 deletions web/flat-web/src/components/Whiteboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const Whiteboard = observer<WhiteboardProps>(function Whiteboard({ whiteb
chessboard: false,
});

whiteboardStore.updateWindowMaximization(
Boolean(whiteboardStore.windowManager?.boxState === "maximized"),
);
whiteboardStore.onMainViewModeChange();
whiteboardStore.onWindowManagerBoxStateChange();
}
Expand Down
12 changes: 6 additions & 6 deletions web/flat-web/src/stores/whiteboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,26 @@ export class WhiteboardStore {
}
};

public addMainViewScene = (): void => {
public addMainViewScene = async (): Promise<void> => {
if (this.room && this.windowManager) {
const currentScene = this.currentSceneIndex + 1;
const scenePath = this.room.state.sceneState.scenePath;
const path = this.dirName(scenePath);

this.room.putScenes(path, [{}], currentScene);
this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
await this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
}
};

public preMainViewScene = (): void => {
public preMainViewScene = async (): Promise<void> => {
if (this.windowManager && this.currentSceneIndex > 0) {
this.windowManager.setMainViewSceneIndex(this.currentSceneIndex - 1);
await this.windowManager.setMainViewSceneIndex(this.currentSceneIndex - 1);
}
};

public nextMainViewScene = (): void => {
public nextMainViewScene = async (): Promise<void> => {
if (this.windowManager && this.currentSceneIndex < this.scenesCount - 1) {
this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
await this.windowManager.setMainViewSceneIndex(this.currentSceneIndex + 1);
}
};

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1963,10 +1963,10 @@
resolved "https://registry.yarnpkg.com/@netless/video-js-plugin/-/video-js-plugin-0.3.7.tgz#6c1f174f20e8a93634e1770e7e535c1302bdf22b"
integrity sha512-UG1t9464w1bZT9kzdhxj/K7R6jqI9sqYfqfUQJ2w9JRWsNibL6O16OC81iwBJT6nkGXEVN7z2pqHvNg1OhKppw==

"@netless/window-manager@^0.2.17":
version "0.2.17"
resolved "https://registry.npmjs.org/@netless/window-manager/-/window-manager-0.2.17.tgz#55f12fc698f3526536f4d05aac154f60a90bccd7"
integrity sha512-1hUpE5WsH9+4ggOFcN0umH/gjAZRO3Jm9MaVK1zPOcM8T63vnI0+h14KUF7/bdvHGL3KNlt+hxHi3uP+M4m1nw==
"@netless/window-manager@^0.2.19-canary.0":
version "0.2.19-canary.0"
resolved "https://registry.npmjs.org/@netless/window-manager/-/window-manager-0.2.19-canary.0.tgz#855a8a2a76718902492db1cd72cc23c4a52b1082"
integrity sha512-zZwgYXY12yV6vWmN9AK6MOJy4uYk8lKYI7M5j61TedqmpiKpagVaeyr5VtiezGKPkEWbXyKUSUws8LBCwMf+Mw==
dependencies:
"@juggle/resize-observer" "^3.3.1"
"@netless/app-docs-viewer" "^0.1.21"
Expand Down

0 comments on commit 885d936

Please sign in to comment.