mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component: correctly create a new node when previous is destroyed
Previously, when a component node had been created and destroyed, and the corresponding component was then recreated, the destroyed node was reused. This commit fixes that
This commit is contained in:
committed by
Aaron Bohy
parent
ced5d0f69f
commit
15e4c856da
@@ -21,9 +21,13 @@ export function component(
|
||||
let node: any = ctx.children[key];
|
||||
let isDynamic = typeof name !== "string";
|
||||
|
||||
if (node && node.status < STATUS.MOUNTED) {
|
||||
node.destroy();
|
||||
node = undefined;
|
||||
if (node) {
|
||||
if (node.status < STATUS.MOUNTED) {
|
||||
node.destroy();
|
||||
node = undefined;
|
||||
} else if (node.status === STATUS.DESTROYED) {
|
||||
node = undefined;
|
||||
}
|
||||
}
|
||||
if (isDynamic && node && node.component.constructor !== name) {
|
||||
node = undefined;
|
||||
|
||||
Reference in New Issue
Block a user