web:fix cannot execute hookAfter in web promise,use setTimeout instead
This commit is contained in:
@@ -196,8 +196,24 @@ export abstract class Panel {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.__rendering__) {
|
||||
//skip
|
||||
Promise.all(promises).then(_ => {
|
||||
})
|
||||
} else {
|
||||
this.__rendering__ = true
|
||||
Promise.all(promises).then(_ => {
|
||||
this.__rendering__ = false
|
||||
this.onRenderFinished()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
Promise.resolve().then(() => {
|
||||
if (this.__rendering__) {
|
||||
//skip
|
||||
return;
|
||||
}
|
||||
this.__rendering__ = true
|
||||
Function("return this")().setTimeout(() => {
|
||||
if (this.__root__.isDirty()) {
|
||||
const model = this.__root__.toModel()
|
||||
promises.push(this.nativeRender(model))
|
||||
@@ -212,18 +228,11 @@ export abstract class Panel {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.__rendering__) {
|
||||
//skip
|
||||
Promise.all(promises).then(_ => {
|
||||
})
|
||||
} else {
|
||||
this.__rendering__ = true
|
||||
Promise.all(promises).then(_ => {
|
||||
this.__rendering__ = false
|
||||
this.onRenderFinished()
|
||||
})
|
||||
Promise.all(promises).then(_ => {
|
||||
this.onRenderFinished()
|
||||
})
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
private onRenderFinished() {
|
||||
|
Reference in New Issue
Block a user