@netless/window-manager 0.4.11-canary.1 → 0.4.11-canary.2
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/constants.d.ts +1 -0
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/AppManager.ts +6 -3
- package/src/constants.ts +1 -0
- package/src/index.ts +2 -2
package/package.json
CHANGED
package/src/AppManager.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AppAttributes, AppStatus, Events, MagixEventName, ROOT_DIR } from "./constants";
|
1
|
+
import { AppAttributes, AppStatus, Events, INIT_DIR, MagixEventName, ROOT_DIR } from "./constants";
|
2
2
|
import { AppCreateQueue } from "./Utils/AppCreateQueue";
|
3
3
|
import { AppListeners } from "./AppListener";
|
4
4
|
import { AppProxy } from "./AppProxy";
|
@@ -106,17 +106,20 @@ export class AppManager {
|
|
106
106
|
}
|
107
107
|
|
108
108
|
private onRemoveScenes = (scenePath: string) => {
|
109
|
+
// 如果移除根目录就把 scenePath 设置为初始值
|
109
110
|
if (scenePath === ROOT_DIR) {
|
110
|
-
this.setMainViewScenePath(
|
111
|
+
this.setMainViewScenePath(INIT_DIR);
|
111
112
|
this.createRootDirScenesCallback();
|
112
113
|
this.onRootDirRemoved();
|
113
114
|
emitter.emit("rootDirRemoved");
|
114
115
|
return;
|
115
116
|
}
|
117
|
+
// 如果移除的 path 跟 MainViewScenePath 相同就取当前目录的当前 index
|
116
118
|
const mainViewScenePath = this.store.getMainViewScenePath();
|
117
119
|
if (this.room && mainViewScenePath) {
|
118
120
|
if (mainViewScenePath === scenePath) {
|
119
|
-
this.
|
121
|
+
const nextPath = this.callbacksNode?.scenes[this.store.getMainViewSceneIndex()];
|
122
|
+
this.setMainViewScenePath(`/${nextPath}` || INIT_DIR);
|
120
123
|
}
|
121
124
|
}
|
122
125
|
};
|
package/src/constants.ts
CHANGED
package/src/index.ts
CHANGED
@@ -6,7 +6,7 @@ import { checkVersion, setupWrapper } from "./Helper";
|
|
6
6
|
import { ContainerResizeObserver } from "./ContainerResizeObserver";
|
7
7
|
import { createBoxManager } from "./BoxManager";
|
8
8
|
import { CursorManager } from "./Cursor";
|
9
|
-
import { DEFAULT_CONTAINER_RATIO, Events, ROOT_DIR } from "./constants";
|
9
|
+
import { DEFAULT_CONTAINER_RATIO, Events, INIT_DIR, ROOT_DIR } from "./constants";
|
10
10
|
import { emitter } from "./InternalEmitter";
|
11
11
|
import { Fields } from "./AttributesDelegate";
|
12
12
|
import { initDb } from "./Register/storage";
|
@@ -870,7 +870,7 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
|
|
870
870
|
this.safeSetAttributes({ [Fields.Cursors]: {} });
|
871
871
|
}
|
872
872
|
if (!this.attributes["_mainScenePath"]) {
|
873
|
-
this.safeSetAttributes({ _mainScenePath:
|
873
|
+
this.safeSetAttributes({ _mainScenePath: INIT_DIR });
|
874
874
|
}
|
875
875
|
if (!this.attributes["_mainSceneIndex"]) {
|
876
876
|
this.safeSetAttributes({ _mainSceneIndex: 0 });
|