mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] move error handling out of fiber, fix complicated mounted issues
This commit is contained in:
committed by
Aaron Bohy
parent
1da3ecdbee
commit
f32b1deb2c
+1
-11
@@ -151,18 +151,11 @@ export interface MountOptions {
|
||||
export class MountFiber extends RootFiber {
|
||||
target: HTMLElement;
|
||||
position: Position;
|
||||
resolve: any;
|
||||
promise: Promise<any>;
|
||||
reject: any;
|
||||
|
||||
constructor(node: ComponentNode, target: HTMLElement, options: MountOptions = {}) {
|
||||
super(node, null);
|
||||
this.target = target;
|
||||
this.position = options.position || "last-child";
|
||||
this.promise = new Promise((resolve, reject) => {
|
||||
this.resolve = resolve;
|
||||
this.reject = reject;
|
||||
});
|
||||
}
|
||||
complete() {
|
||||
let current: Fiber | undefined = this;
|
||||
@@ -195,10 +188,7 @@ export class MountFiber extends RootFiber {
|
||||
}
|
||||
node.fiber = null;
|
||||
} catch (e) {
|
||||
if (!handleError({ fiber: current as Fiber, error: e })) {
|
||||
this.reject(e);
|
||||
}
|
||||
handleError({ fiber: current as Fiber, error: e });
|
||||
}
|
||||
this.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user