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

closes odoo/documentation#2275

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 06d259b93d
commit b3f26c2914

View File

@ -16,7 +16,7 @@
element.addEventListener('click', async event => {
if (element.hasAttribute('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();
const fallbackUrls = await _generateFallbackUrls(targetUrl);
const fallbackUrl = await _getFirstValidUrl(fallbackUrls);