mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
fix: designer/loadIncrementalAssets await Sequential (#841)
* fix: designer/loadIncrementalAssets await Sequential * feat: change editor set support Promise
This commit is contained in:
parent
70e7c1c2e8
commit
8232424697
@ -403,7 +403,8 @@ export class Designer {
|
|||||||
// 合并assets
|
// 合并assets
|
||||||
let assets = this.editor.get('assets');
|
let assets = this.editor.get('assets');
|
||||||
let newAssets = megreAssets(assets, incrementalAssets);
|
let newAssets = megreAssets(assets, incrementalAssets);
|
||||||
this.editor.set('assets', newAssets);
|
// 对于 assets 存在需要二次网络下载的过程,必须 await 等待结束之后,再进行事件触发
|
||||||
|
await this.editor.set('assets', newAssets);
|
||||||
}
|
}
|
||||||
// TODO: 因为涉及修改 prototype.view,之后在 renderer 里修改了 vc 的 view 获取逻辑后,可删除
|
// TODO: 因为涉及修改 prototype.view,之后在 renderer 里修改了 vc 的 view 获取逻辑后,可删除
|
||||||
this.refreshComponentMetasMap();
|
this.refreshComponentMetasMap();
|
||||||
|
|||||||
@ -76,10 +76,9 @@ export class Editor extends (EventEmitter as any) implements IEditor {
|
|||||||
return this.context.has(keyOrType);
|
return this.context.has(keyOrType);
|
||||||
}
|
}
|
||||||
|
|
||||||
set(key: KeyType, data: any): void {
|
set(key: KeyType, data: any): void | Promise<void> {
|
||||||
if (key === 'assets') {
|
if (key === 'assets') {
|
||||||
this.setAssets(data);
|
return this.setAssets(data);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// store the data to engineConfig while invoking editor.set()
|
// store the data to engineConfig while invoking editor.set()
|
||||||
if (!keyBlacklist.includes(key as string)) {
|
if (!keyBlacklist.includes(key as string)) {
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export interface IEditor extends StrictEventEmitter<EventEmitter, GlobalEvent.Ev
|
|||||||
|
|
||||||
has: (keyOrType: KeyType) => boolean;
|
has: (keyOrType: KeyType) => boolean;
|
||||||
|
|
||||||
set: (key: KeyType, data: any) => void;
|
set: (key: KeyType, data: any) => void | Promise<void>;
|
||||||
|
|
||||||
onceGot: <T = undefined, KeyOrType extends KeyType = any>
|
onceGot: <T = undefined, KeyOrType extends KeyType = any>
|
||||||
(keyOrType: KeyOrType) => Promise<GetReturnType<T, KeyOrType>>;
|
(keyOrType: KeyOrType) => Promise<GetReturnType<T, KeyOrType>>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user