summaryrefslogtreecommitdiff
path: root/addons/web/static/lib
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2021-01-08 14:32:26 +0000
committerSébastien Theys <seb@odoo.com>2021-01-11 12:43:14 +0000
commit1e87d7b65bdfef323a6cdae3a54b3beb6aacf3b4 (patch)
tree4062b546d0ff9e38bc189d61132b79ba324f1cd5 /addons/web/static/lib
parent81e574aae3059844179dd9f54a241cd51a2474fd (diff)
[FIX] web: update owl to last version
This commit updates owl from v1.2.0 to v1.2.1 See [1] for the list of changes. [1] https://github.com/odoo/owl/commit/25738a1bf08ff47b2d8cb7b7c57d3bf4a7e1caa7
Diffstat (limited to 'addons/web/static/lib')
-rw-r--r--addons/web/static/lib/owl/owl.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/addons/web/static/lib/owl/owl.js b/addons/web/static/lib/owl/owl.js
index 084ba31e303..a05c1a018f3 100644
--- a/addons/web/static/lib/owl/owl.js
+++ b/addons/web/static/lib/owl/owl.js
@@ -3417,6 +3417,7 @@
this.parent = parent;
let oldFiber = __owl__.currentFiber;
if (oldFiber && !oldFiber.isCompleted) {
+ this.force = true;
if (oldFiber.root === oldFiber && !parent) {
// both oldFiber and this fiber are root fibers
this._reuseFiber(oldFiber);
@@ -4778,6 +4779,10 @@
}, ...payload);
return result;
}
+ __notifyComponents() {
+ this.trigger("before-update");
+ return super.__notifyComponents();
+ }
}
const isStrictEqual = (a, b) => a === b;
function useStore(selector, options = {}) {
@@ -4800,13 +4805,16 @@
const newRevNumber = hashFn(result);
if ((newRevNumber > 0 && revNumber !== newRevNumber) || !isEqual(oldResult, result)) {
revNumber = newRevNumber;
- if (options.onUpdate) {
- options.onUpdate(result);
- }
return true;
}
return false;
}
+ if (options.onUpdate) {
+ store.on("before-update", component, () => {
+ const newValue = selector(store.state, component.props);
+ options.onUpdate(newValue);
+ });
+ }
store.updateFunctions[componentId].push(function () {
return selectCompareUpdate(store.state, component.props);
});
@@ -4825,6 +4833,9 @@
const __destroy = component.__destroy;
component.__destroy = (parent) => {
delete store.updateFunctions[componentId];
+ if (options.onUpdate) {
+ store.off("before-update", component);
+ }
__destroy.call(component, parent);
};
if (typeof result !== "object" || result === null) {
@@ -5353,9 +5364,9 @@
exports.utils = utils;
- __info__.version = '1.2.0';
- __info__.date = '2020-12-14T12:37:32.543Z';
- __info__.hash = '144b323';
+ __info__.version = '1.2.1';
+ __info__.date = '2021-01-08T14:30:24.560Z';
+ __info__.hash = '25738a1';
__info__.url = 'https://github.com/odoo/owl';