web:fix cannot execute hookAfter in web promise,use setTimeout instead

This commit is contained in:
pengfei.zhou
2021-04-13 18:28:45 +08:00
committed by osborn
parent ace3d30e73
commit 4873ff535d
18 changed files with 140 additions and 1640 deletions

View File

@@ -1171,9 +1171,26 @@ var Panel = /** @class */ (function () {
}
finally { if (e_4) { throw e_4.error; } }
}
if (this.__rendering__) {
//skip
Promise.all(promises).then(function (_) {
});
}
else {
this.__rendering__ = true;
Promise.all(promises).then(function (_) {
_this.__rendering__ = false;
_this.onRenderFinished();
});
}
}
else {
Promise.resolve().then(function () {
if (this.__rendering__) {
//skip
return;
}
this.__rendering__ = true;
Function("return this")().setTimeout(function () {
var e_6, _a, e_7, _b;
if (_this.__root__.isDirty()) {
var model = _this.__root__.toModel();
@@ -1209,19 +1226,11 @@ var Panel = /** @class */ (function () {
}
finally { if (e_6) { throw e_6.error; } }
}
});
}
if (this.__rendering__) {
//skip
Promise.all(promises).then(function (_) {
});
}
else {
this.__rendering__ = true;
Promise.all(promises).then(function (_) {
_this.__rendering__ = false;
_this.onRenderFinished();
});
Promise.all(promises).then(function (_) {
_this.onRenderFinished();
});
}, 0);
}
};
Panel.prototype.onRenderFinished = function () {

View File

@@ -890,9 +890,26 @@ 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));
@@ -907,19 +924,11 @@ 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);
}
}
onRenderFinished() {

View File

@@ -2389,9 +2389,26 @@ 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));
@@ -2406,19 +2423,11 @@ 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);
}
}
onRenderFinished() {