From 9c6cda791e2a80de79084efdf53621730a6ce8f9 Mon Sep 17 00:00:00 2001 From: Adrien Dieudonne Date: Mon, 12 Jul 2021 11:54:50 +0000 Subject: [PATCH] [FIX] point_of_sale: env.isMobile not defined at startup Before this commit, env.isMobile was defined lately and you have to wait the next update of the template. Steps to reproduce: - Open "bar" POS session => 'pos-branding' is present in the header bar X-original-commit: 931304b9e7085c77e5b9bed8054ae47fc2a6168f Part-of: odoo/odoo#79448 --- addons/point_of_sale/static/src/js/chrome_adapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/chrome_adapter.js b/addons/point_of_sale/static/src/js/chrome_adapter.js index 68a0e886de3..d142b31fdac 100644 --- a/addons/point_of_sale/static/src/js/chrome_adapter.js +++ b/addons/point_of_sale/static/src/js/chrome_adapter.js @@ -28,6 +28,8 @@ export class ChromeAdapter extends Component { this.env = owl.Component.env; useBus(this.env.qweb, "update", () => this.render()); + setupResponsivePlugin(this.env); + const chrome = owl.hooks.useRef("chrome"); owl.hooks.onMounted(async () => { // Add the pos error handler when the chrome component is available. @@ -47,7 +49,6 @@ export class ChromeAdapter extends Component { configureGui({ component: chrome.comp }); await chrome.comp.start(); registry.category("main_components").add("BlockUI", BlockUiFromRegistry); - setupResponsivePlugin(this.env); }); } }