@netless/window-manager 0.3.26 → 0.3.27
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.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/docs/0.3.x-clean-all-scenes.md +19 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
## 清除所有笔迹
|
2
|
+
|
3
|
+
```ts
|
4
|
+
// 删除根目录所有 scenes
|
5
|
+
room.removeScenes("/")
|
6
|
+
|
7
|
+
// 关闭所有 App
|
8
|
+
manager.queryAll().map(app => manager.closeApp(app.id))
|
9
|
+
|
10
|
+
// 清除掉之前的 index 信息
|
11
|
+
manager.safeSetAttributes({ _mainSceneIndex: undefined, _mainScenePath: undefined });
|
12
|
+
|
13
|
+
// 如果当前主白板 index 在第一页则切换一下 index 才可以让第一页恢复可写
|
14
|
+
setTimeout(async () => {
|
15
|
+
room.putScenes("/", [{}]);
|
16
|
+
await manager.setMainViewSceneIndex(1);
|
17
|
+
await manager.setMainViewSceneIndex(0);
|
18
|
+
}, 50);
|
19
|
+
```
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -402,6 +402,9 @@ export class WindowManager extends InvisiblePlugin<WindowMangerAttributes> {
|
|
402
402
|
params.options.scenePath = ensureValidScenePath(params.options.scenePath);
|
403
403
|
}
|
404
404
|
const appId = await this.appManager.addApp(params, Boolean(isDynamicPPT));
|
405
|
+
// 瞬间调用多个 addApp 可能会造成 view 的状态设置错误, 这里手动加一个延迟
|
406
|
+
// 在 0.4.x 的版本已经重构了这个行为, 这里只是 workaround
|
407
|
+
await wait(200);
|
405
408
|
return appId;
|
406
409
|
} else {
|
407
410
|
throw new AppManagerNotInitError();
|