mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
fixup, maybe
This commit is contained in:
@@ -201,19 +201,8 @@ export class ComponentNode<T extends typeof Component = typeof Component>
|
||||
|
||||
async updateAndRender(props: any, parentFiber: Fiber) {
|
||||
// update
|
||||
const root = this.fiber && this.fiber.root;
|
||||
const fiber = makeChildFiber(this, parentFiber);
|
||||
const parentRoot = parentFiber.root;
|
||||
const rootChanged = root !== parentRoot;
|
||||
this.fiber = fiber;
|
||||
if (rootChanged) {
|
||||
if (this.willPatch.length) {
|
||||
parentRoot.willPatch.push(fiber);
|
||||
}
|
||||
if (this.patched.length) {
|
||||
parentRoot.patched.push(fiber);
|
||||
}
|
||||
}
|
||||
const component = this.component;
|
||||
applyDefaultProps(props, component.constructor as any);
|
||||
const prom = Promise.all(this.willUpdateProps.map((f) => f.call(component, props)));
|
||||
@@ -221,8 +210,15 @@ export class ComponentNode<T extends typeof Component = typeof Component>
|
||||
if (fiber !== this.fiber) {
|
||||
return;
|
||||
}
|
||||
this.component.props = props;
|
||||
component.props = props;
|
||||
this._render(fiber);
|
||||
const parentRoot = parentFiber.root;
|
||||
if (this.willPatch.length) {
|
||||
parentRoot.willPatch.push(fiber);
|
||||
}
|
||||
if (this.patched.length) {
|
||||
parentRoot.patched.push(fiber);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user