[REF] web: remove use of internal variable
In a previous commit, we temporarily used the `__OWL__DEVTOOLS__` global variable to access the list of all apps. This was obviously not something that we want to do, so we introduced a proper hook in Owl. This commit changes the code to use the static apps object from the App class. closes odoo/odoo#137661 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { memoize } from "./utils/functions";
|
|||||||
import { browser } from "./browser/browser";
|
import { browser } from "./browser/browser";
|
||||||
import { registry } from "./registry";
|
import { registry } from "./registry";
|
||||||
import { session } from "@web/session";
|
import { session } from "@web/session";
|
||||||
|
import { Component, xml, onWillStart, App } from "@odoo/owl";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This export is done only in order to modify the behavior of the exported
|
* This export is done only in order to modify the behavior of the exported
|
||||||
@@ -236,15 +237,12 @@ registry.category("xml_templates").addEventListener("UPDATE", (ev) => {
|
|||||||
for (const element of doc.querySelectorAll("templates > [t-name]")) {
|
for (const element of doc.querySelectorAll("templates > [t-name]")) {
|
||||||
templates.documentElement.appendChild(element);
|
templates.documentElement.appendChild(element);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-undef
|
for (const app of App.apps) {
|
||||||
const apps = __OWL_DEVTOOLS__.apps;
|
|
||||||
for (const app of apps) {
|
|
||||||
app.addTemplates(templates, app);
|
app.addTemplates(templates, app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
import { Component, xml, onWillStart } from "@odoo/owl";
|
|
||||||
/**
|
/**
|
||||||
* Utility component that loads an asset bundle before instanciating a component
|
* Utility component that loads an asset bundle before instanciating a component
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user