feat:fix when call build and onShow at once,then onRenderFinishedCallback maybe called before the render action finished

This commit is contained in:
pengfei.zhou
2020-04-27 15:08:18 +08:00
committed by osborn
parent cabb1b1f82
commit c34fe50104
8 changed files with 80 additions and 19 deletions

View File

@@ -949,6 +949,7 @@ var Panel = /** @class */ (function () {
this.__root__ = new Root;
this.headviews = new Map;
this.onRenderFinishedCallback = [];
this.__rendering__ = false;
}
Panel.prototype.onCreate = function () { };
Panel.prototype.onDestroy = function () { };
@@ -1176,9 +1177,18 @@ var Panel = /** @class */ (function () {
}
});
}
Promise.all(promises).then(function (_) {
_this.onRenderFinished();
});
if (this.__rendering__) {
//skip
Promise.all(promises).then(function (_) {
});
}
else {
this.__rendering__ = true;
Promise.all(promises).then(function (_) {
_this.__rendering__ = false;
_this.onRenderFinished();
});
}
};
Panel.prototype.onRenderFinished = function () {
this.onRenderFinishedCallback.forEach(function (e) {

View File

@@ -704,6 +704,7 @@ class Panel {
this.__root__ = new Root;
this.headviews = new Map;
this.onRenderFinishedCallback = [];
this.__rendering__ = false;
}
onCreate() { }
onDestroy() { }
@@ -853,9 +854,18 @@ class Panel {
}
});
}
Promise.all(promises).then(_ => {
this.onRenderFinished();
});
if (this.__rendering__) {
//skip
Promise.all(promises).then(_ => {
});
}
else {
this.__rendering__ = true;
Promise.all(promises).then(_ => {
this.__rendering__ = false;
this.onRenderFinished();
});
}
}
onRenderFinished() {
this.onRenderFinishedCallback.forEach(e => {

View File

@@ -2163,6 +2163,7 @@ class Panel {
this.__root__ = new Root;
this.headviews = new Map;
this.onRenderFinishedCallback = [];
this.__rendering__ = false;
}
onCreate() { }
onDestroy() { }
@@ -2312,9 +2313,18 @@ class Panel {
}
});
}
Promise.all(promises).then(_ => {
this.onRenderFinished();
});
if (this.__rendering__) {
//skip
Promise.all(promises).then(_ => {
});
}
else {
this.__rendering__ = true;
Promise.all(promises).then(_ => {
this.__rendering__ = false;
this.onRenderFinished();
});
}
}
onRenderFinished() {
this.onRenderFinishedCallback.forEach(e => {