@netless/window-manager 0.4.0-canary.18 → 0.4.0-canary.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/window-manager",
3
- "version": "0.4.0-canary.18",
3
+ "version": "0.4.0-canary.19",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",
package/src/AppManager.ts CHANGED
@@ -511,6 +511,7 @@ export class AppManager {
511
511
  const reconnected = appProxies.map(appProxy => {
512
512
  return appProxy.onReconnected();
513
513
  });
514
+ this.mainViewProxy.onReconnect();
514
515
  await Promise.all(reconnected);
515
516
  }
516
517
 
@@ -1,4 +1,4 @@
1
- import { compact, throttle, uniq } from "lodash";
1
+ import { throttle } from "lodash";
2
2
  import { Cursor } from "./Cursor";
3
3
  import { CursorState, Events } from "../constants";
4
4
  import { emitter, WindowManager } from "../index";
@@ -66,10 +66,6 @@ export class CursorManager {
66
66
  this.mainViewElement = div;
67
67
  }
68
68
 
69
- private getUids = (members: readonly RoomMember[] | undefined) => {
70
- return compact(uniq(members?.map(member => member.payload?.uid)));
71
- };
72
-
73
69
  public get boxState() {
74
70
  return this.store.getBoxState();
75
71
  }
@@ -13,7 +13,6 @@ export class MainViewProxy {
13
13
  private started = false;
14
14
  private mainViewIsAddListener = false;
15
15
  private mainView: View;
16
- private viewId = "mainView";
17
16
  private store = this.manager.store;
18
17
 
19
18
  private sideEffectManager = new SideEffectManager();
@@ -104,6 +103,13 @@ export class MainViewProxy {
104
103
  return mainView;
105
104
  }
106
105
 
106
+ public onReconnect(): void {
107
+ const mainViewScenePath = this.store.getMainViewScenePath();
108
+ if (mainViewScenePath) {
109
+ setViewFocusScenePath(this.view, mainViewScenePath);
110
+ }
111
+ }
112
+
107
113
  private onCameraUpdatedByDevice = (camera: Camera) => {
108
114
  this.store.setMainViewCamera({ ...camera, id: this.manager.uid });
109
115
  if (!isEqual(this.mainViewSize, { ...this.mainView.size, id: this.manager.uid })) {