mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component/hooks: onWillUnmount was not properly called
This commit is contained in:
@@ -437,6 +437,9 @@ export class Component<T extends Env, Props extends {}> {
|
||||
const __owl__ = this.__owl__;
|
||||
const isMounted = __owl__.isMounted;
|
||||
if (isMounted) {
|
||||
if (__owl__.willUnmountCB) {
|
||||
__owl__.willUnmountCB();
|
||||
}
|
||||
this.willUnmount();
|
||||
__owl__.isMounted = false;
|
||||
}
|
||||
@@ -466,7 +469,7 @@ export class Component<T extends Env, Props extends {}> {
|
||||
try {
|
||||
this.mounted();
|
||||
if (__owl__.mountedCB) {
|
||||
__owl__.mountedCB()
|
||||
__owl__.mountedCB();
|
||||
}
|
||||
} catch (e) {
|
||||
errorHandler(e, this);
|
||||
|
||||
Reference in New Issue
Block a user