@netless/window-manager 1.0.6 → 1.0.7-beta.0
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/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AppManager.ts +15 -5
package/package.json
CHANGED
package/src/AppManager.ts
CHANGED
@@ -3,7 +3,7 @@ import { AppCreateQueue } from "./Utils/AppCreateQueue";
|
|
3
3
|
import { AppListeners } from "./AppListener";
|
4
4
|
import { AppProxy } from "./App";
|
5
5
|
import { appRegister } from "./Register";
|
6
|
-
import { autorun, isPlayer, isRoom, ScenePathType } from "white-web-sdk";
|
6
|
+
import { autorun, isPlayer, isRoom, ScenePathType, UpdateEventKind } from "white-web-sdk";
|
7
7
|
import { boxEmitter } from "./BoxEmitter";
|
8
8
|
import { calculateNextIndex } from "./Page";
|
9
9
|
import { callbacks } from "./callback";
|
@@ -12,7 +12,7 @@ import { internalEmitter } from "./InternalEmitter";
|
|
12
12
|
import { Fields, store } from "./AttributesDelegate";
|
13
13
|
import { log } from "./Utils/log";
|
14
14
|
import { MainViewProxy } from "./View/MainView";
|
15
|
-
import {
|
15
|
+
import { safeListenPropsUpdated } from "./Utils/Reactive";
|
16
16
|
import { reconnectRefresher, WindowManager } from "./index";
|
17
17
|
import { RedoUndo } from "./RedoUndo";
|
18
18
|
import { SideEffectManager } from "side-effect-manager";
|
@@ -438,10 +438,20 @@ export class AppManager {
|
|
438
438
|
};
|
439
439
|
|
440
440
|
public addAppCloseListener = () => {
|
441
|
+
// this.refresher.add("appsClose", () => {
|
442
|
+
// return onObjectRemoved(this.attributes.apps, () => {
|
443
|
+
// this.onAppDelete(this.attributes.apps);
|
444
|
+
// });
|
445
|
+
// });
|
441
446
|
this.refresher.add("appsClose", () => {
|
442
|
-
return
|
443
|
-
|
444
|
-
|
447
|
+
return safeListenPropsUpdated(
|
448
|
+
() => this.attributes.apps,
|
449
|
+
events => {
|
450
|
+
if (events.some(e => e.kind === UpdateEventKind.Removed)) {
|
451
|
+
this.onAppDelete(this.attributes.apps);
|
452
|
+
}
|
453
|
+
}
|
454
|
+
);
|
445
455
|
});
|
446
456
|
};
|
447
457
|
|