From df3aa416d59de58390ed4033c33753405a207307 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Thu, 3 Oct 2024 10:53:22 +0200 Subject: [PATCH] Prevent Sidebar to redirect from /latest/ to the // in api pages. Looks like the component now triggers the selected and changed event on render. --- app/_assets/javascripts/components/Sidebar.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/_assets/javascripts/components/Sidebar.vue b/app/_assets/javascripts/components/Sidebar.vue index 7433e6d3ebfb..3e4b7cf1c152 100644 --- a/app/_assets/javascripts/components/Sidebar.vue +++ b/app/_assets/javascripts/components/Sidebar.vue @@ -100,6 +100,11 @@ function onSelectedVersion (event) { } const currentPath = window.location.pathname; let versionSegment = versionToRelease(version.name); + const latestVersion = props.product.latest_version.name; + + if (version.name === latestVersion && currentPath.includes('/latest/')) { + return; + } let newPathname = currentPath.split('/').slice(0, -2).concat(versionSegment).join('/').concat('/') if (newPathname !== window.location.pathname) {