mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] app: slightly simplify the create component path
This commit is contained in:
committed by
Sam Degueldre
parent
7f580a4e1d
commit
6f86beeaf3
+1
-5
@@ -3,7 +3,6 @@ import { ComponentNode } from "./component_node";
|
||||
import { nodeErrorHandlers } from "./error_handling";
|
||||
import { Fiber, MountOptions } from "./fibers";
|
||||
import { Scheduler } from "./scheduler";
|
||||
import { STATUS } from "./status";
|
||||
import { validateProps } from "./template_helpers";
|
||||
import { TemplateSet, TemplateSetConfig } from "./template_set";
|
||||
import { validateTarget } from "./utils";
|
||||
@@ -141,10 +140,7 @@ export class App<
|
||||
return (props: P, key: string, ctx: ComponentNode, parent: any, C: any) => {
|
||||
let children = ctx.children;
|
||||
let node: any = children[key];
|
||||
if (
|
||||
node &&
|
||||
(node.status === STATUS.DESTROYED || (isDynamic && node.component.constructor !== C))
|
||||
) {
|
||||
if (isDynamic && node && node.component.constructor !== C) {
|
||||
node = undefined;
|
||||
}
|
||||
const parentFiber = ctx.fiber!;
|
||||
|
||||
@@ -56,6 +56,7 @@ function cancelFibers(fibers: Fiber[]): number {
|
||||
fiber.render = throwOnRender;
|
||||
if (node.status === STATUS.NEW) {
|
||||
node.destroy();
|
||||
delete node.parent!.children[node.parentKey!];
|
||||
}
|
||||
node.fiber = null;
|
||||
if (fiber.bdom) {
|
||||
|
||||
Reference in New Issue
Block a user