[FIX] component/hooks: onWillUnmount was not properly called

This commit is contained in:
Géry Debongnie
2019-10-07 16:01:28 +02:00
parent 50d569411c
commit 683993dbc4
2 changed files with 80 additions and 3 deletions
+4 -1
View File
@@ -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);