@netless/window-manager 1.0.10-beta.0 → 1.0.10-beta.1

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": "1.0.10-beta.0",
3
+ "version": "1.0.10-beta.1",
4
4
  "description": "Multi-window mode for Netless Whiteboard",
5
5
  "author": "l1shen <lishen1635@gmail.com> (https://github.com/l1shen)",
6
6
  "license": "MIT",
@@ -282,13 +282,16 @@ export class AppProxy implements PageRemoveService {
282
282
  await this.destroy(true, false, true);
283
283
  return;
284
284
  }
285
+ console.log('onReconnected====>', this.id);
285
286
  this.appEmitter.emit("reconnected", undefined);
286
287
  const currentAppState = this.getAppInitState(this.id);
288
+ console.log('onReconnected====>0000', currentAppState?.boxStatus);
287
289
  await this.destroy(true, false, true);
288
290
  const params = this.params;
289
291
  const AppProxyClass = getExtendClass(AppProxy, WindowManager.extendClass);
290
292
  const appProxy = new AppProxyClass(params, this.manager, this.id, this.isAddApp);
291
293
  await appProxy.baseInsertApp(true);
294
+ console.log('onReconnected====>', currentAppState?.boxStatus);
292
295
  this.boxManager?.updateBoxState(currentAppState);
293
296
  }
294
297
 
package/src/AppManager.ts CHANGED
@@ -356,6 +356,7 @@ export class AppManager {
356
356
  this.focusByAttributes(this.attributes.apps);
357
357
  });
358
358
  }
359
+ await this._attributesUpdateCallback(this.attributes.apps);
359
360
  internalEmitter.emit("updateManagerRect");
360
361
  boxEmitter.on("move", this.onBoxMove);
361
362
  boxEmitter.on("resize", this.onBoxResize);
@@ -367,7 +368,6 @@ export class AppManager {
367
368
  this.addAppsChangeListener();
368
369
  this.addAppCloseListener();
369
370
  this.addBoxesStatusChangeListener();
370
- await this._attributesUpdateCallback(this.attributes.apps);
371
371
  this.refresher.add("maximized", () => {
372
372
  return autorun(() => {
373
373
  const maximized = this.attributes.maximized;
@@ -467,6 +467,8 @@ export class AppManager {
467
467
  };
468
468
 
469
469
  private notifyBoxesStatusChange = debounce(() => {
470
+ console.log('setBoxesStatus====>', this.attributes.boxesStatus);
471
+ this.boxManager?.setBoxesStatus(this.attributes.boxesStatus);
470
472
  const entries = Object.entries(this.attributes.boxesStatus);
471
473
  if (entries.length > 0) {
472
474
  entries.forEach(([appId, status]) => {
@@ -476,14 +478,14 @@ export class AppManager {
476
478
  }
477
479
  });
478
480
  }
479
- }, 50);
481
+ }, 100);
480
482
 
481
483
  public addBoxesStatusChangeListener = () => {
482
484
  this.refresher.add("boxesStatus", () => {
483
485
  return safeListenPropsUpdated(
484
486
  () => this.attributes.boxesStatus,
485
487
  () => {
486
- this.boxManager?.setBoxesStatus(this.attributes.boxesStatus);
488
+ console.log('setBoxesStatus====>000', this.attributes.boxesStatus);
487
489
  this.notifyBoxesStatusChange();
488
490
  }
489
491
  );