@netless/window-manager 0.4.69 → 0.4.70
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AppManager.ts +15 -25
package/package.json
CHANGED
package/src/AppManager.ts
CHANGED
@@ -31,13 +31,7 @@ import {
|
|
31
31
|
} from "./Utils/Common";
|
32
32
|
import type { ReconnectRefresher } from "./ReconnectRefresher";
|
33
33
|
import type { BoxManager } from "./BoxManager";
|
34
|
-
import type {
|
35
|
-
Displayer,
|
36
|
-
Room,
|
37
|
-
ScenesCallbacksNode,
|
38
|
-
SceneState,
|
39
|
-
RoomState,
|
40
|
-
} from "white-web-sdk";
|
34
|
+
import type { Displayer, Room, ScenesCallbacksNode, SceneState, RoomState } from "white-web-sdk";
|
41
35
|
import type { AddAppParams, BaseInsertParams, TeleBoxRect } from "./index";
|
42
36
|
import type {
|
43
37
|
BoxClosePayload,
|
@@ -47,7 +41,6 @@ import type {
|
|
47
41
|
BoxStateChangePayload,
|
48
42
|
} from "./BoxEmitter";
|
49
43
|
|
50
|
-
|
51
44
|
export class AppManager {
|
52
45
|
public displayer: Displayer;
|
53
46
|
public viewManager: ViewManager;
|
@@ -462,7 +455,10 @@ export class AppManager {
|
|
462
455
|
|
463
456
|
private _appIds: string[] = [];
|
464
457
|
public notifyAppsChange(appIds: string[]): void {
|
465
|
-
if (
|
458
|
+
if (
|
459
|
+
this._appIds.length !== appIds.length ||
|
460
|
+
!this._appIds.every(id => appIds.includes(id))
|
461
|
+
) {
|
466
462
|
this._appIds = appIds;
|
467
463
|
callbacks.emit("appsChange", appIds);
|
468
464
|
}
|
@@ -480,12 +476,16 @@ export class AppManager {
|
|
480
476
|
if (appIds.length === 0) {
|
481
477
|
this.appCreateQueue.emitReady();
|
482
478
|
}
|
483
|
-
const appsWithCreatedAt = orderBy(
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
479
|
+
const appsWithCreatedAt = orderBy(
|
480
|
+
appIds.map(appId => {
|
481
|
+
return {
|
482
|
+
id: appId,
|
483
|
+
createdAt: apps[appId].createdAt,
|
484
|
+
};
|
485
|
+
}),
|
486
|
+
"createdAt",
|
487
|
+
"asc"
|
488
|
+
);
|
489
489
|
const orderedAppIds = appsWithCreatedAt.map(({ id }) => id);
|
490
490
|
this.notifyAppsChange(orderedAppIds);
|
491
491
|
for (const id of orderedAppIds) {
|
@@ -663,16 +663,6 @@ export class AppManager {
|
|
663
663
|
}
|
664
664
|
|
665
665
|
private displayerStateListener = (state: Partial<RoomState>) => {
|
666
|
-
const sceneState = state.sceneState;
|
667
|
-
if (sceneState) {
|
668
|
-
const scenePath = sceneState.scenePath;
|
669
|
-
this.appProxies.forEach(appProxy => {
|
670
|
-
if (appProxy.scenePath && scenePath.startsWith(appProxy.scenePath)) {
|
671
|
-
appProxy.emitAppSceneStateChange(sceneState);
|
672
|
-
appProxy.setFullPath(scenePath);
|
673
|
-
}
|
674
|
-
});
|
675
|
-
}
|
676
666
|
this.appProxies.forEach(appProxy => {
|
677
667
|
appProxy.appEmitter.emit("roomStateChange", state);
|
678
668
|
});
|