mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component: concurrent rendering issue
Resolved rendering with cancelled fiber for (not yet) destroyed component -> Cannot read property 'sel' of null Closes #421
This commit is contained in:
committed by
Géry Debongnie
parent
7e721a96b5
commit
e47f604449
@@ -438,6 +438,9 @@ export class Component<T extends Env, Props extends {}> {
|
||||
}
|
||||
__owl__.isDestroyed = true;
|
||||
delete __owl__.vnode;
|
||||
if (__owl__.currentFiber) {
|
||||
__owl__.currentFiber.isCancelled = true;
|
||||
}
|
||||
}
|
||||
|
||||
__callMounted() {
|
||||
|
||||
@@ -455,7 +455,7 @@ QWeb.addDirective({
|
||||
);
|
||||
ctx.addLine(`const fiber = w${componentID}.__owl__.currentFiber;`);
|
||||
ctx.addLine(
|
||||
`def${defID}.then(function () {if (w${componentID}.__owl__.isDestroyed) {return;} const vnode = fiber.vnode; pvnode.sel = vnode.sel; ${createHook}});`
|
||||
`def${defID}.then(function () {if (fiber.isCancelled) {return;} const vnode = fiber.vnode; pvnode.sel = vnode.sel; ${createHook}});`
|
||||
);
|
||||
if (registerCode) {
|
||||
ctx.addLine(registerCode);
|
||||
|
||||
Reference in New Issue
Block a user