[FIX] odoo_theme: correctly test for fallback URLs when using switchers

closes odoo/documentation#2273

X-original-commit: 9e84b6f681
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Antoine Vandevenne (anv) 2022-06-22 14:27:12 +00:00
parent 6655c0800e
commit 4ff6271ad8

View File

@ -16,7 +16,7 @@
element.addEventListener('click', async event => { element.addEventListener('click', async event => {
if (element.hasAttribute('href')) { if (element.hasAttribute('href')) {
const targetUrl = element.getAttribute('href'); const targetUrl = element.getAttribute('href');
if (!targetUrl.startWith('/')) { // Don't test for valid URLs if in localhost. if (!targetUrl.startsWith('/')) { // Don't test for valid URLs if in localhost.
event.preventDefault(); event.preventDefault();
const fallbackUrls = await _generateFallbackUrls(targetUrl); const fallbackUrls = await _generateFallbackUrls(targetUrl);
const fallbackUrl = await _getFirstValidUrl(fallbackUrls); const fallbackUrl = await _getFirstValidUrl(fallbackUrls);