Skip to content

High performance self-hosted photo and video management solution.

docs: #15988 follow-up: Use URL constructor to fix Version Switcher URL double slash issue (#16014)

Nicholas Flamy16266c9f5aca
diff --git a/docs/src/components/version-switcher.tsx b/docs/src/components/version-switcher.tsx
index c02ad444c8..016e4ac1e6 100644
--- a/docs/src/components/version-switcher.tsx
+++ b/docs/src/components/version-switcher.tsx
@@ -24,10 +24,13 @@ export default function VersionSwitcher(): JSX.Element {
{ label: 'Next', url: 'https://main.preview.immich.app' },
{ label: 'Latest', url: 'https://immich.app' },
...archiveVersions,
- ];
+ ].map(({ label, url }) => ({
+ label,
+ url: new URL(url),
+ }));
setVersions(allVersions);
- const activeVersion = allVersions.find((version) => new URL(version.url).origin === window.location.origin);
+ const activeVersion = allVersions.find((version) => version.url.origin === window.location.origin);
if (activeVersion) {
setLabel(activeVersion.label);
}
@@ -49,7 +52,7 @@ export default function VersionSwitcher(): JSX.Element {
mobile={windowSize === 'mobile'}
items={versions.map(({ label, url }) => ({
label,
- to: url + location.pathname + location.hash,
+ to: new URL(location.pathname + location.search + location.hash, url).href,
target: '_self',
}))}
/>
diff --git a/docs/static/archived-versions.json b/docs/static/archived-versions.json
index a9fd22de84..516a978f50 100644
--- a/docs/static/archived-versions.json
+++ b/docs/static/archived-versions.json
@@ -19,10 +19,6 @@
"label": "v1.125.5",
"url": "https://v1.125.5.archive.immich.app"
},
- {
- "label": "v1.125.4",
- "url": "https://v1.125.4.archive.immich.app"
- },
{
"label": "v1.125.3",
"url": "https://v1.125.3.archive.immich.app"
@@ -35,10 +31,6 @@
"label": "v1.125.1",
"url": "https://v1.125.1.archive.immich.app"
},
- {
- "label": "v1.125.0",
- "url": "https://v1.125.0.archive.immich.app"
- },
{
"label": "v1.124.2",
"url": "https://v1.124.2.archive.immich.app"
@@ -201,46 +193,46 @@
},
{
"label": "v1.105.1",
- "url": "https://v1.105.1.archive.immich.app/"
+ "url": "https://v1.105.1.archive.immich.app"
},
{
"label": "v1.105.0",
- "url": "https://v1.105.0.archive.immich.app/"
+ "url": "https://v1.105.0.archive.immich.app"
},
{
"label": "v1.104.0",
- "url": "https://v1.104.0.archive.immich.app/"
+ "url": "https://v1.104.0.archive.immich.app"
},
{
"label": "v1.103.1",
- "url": "https://v1.103.1.archive.immich.app/"
+ "url": "https://v1.103.1.archive.immich.app"
},
{
"label": "v1.103.0",
- "url": "https://v1.103.0.archive.immich.app/"
+ "url": "https://v1.103.0.archive.immich.app"
},
{
"label": "v1.102.3",
- "url": "https://v1.102.3.archive.immich.app/"
+ "url": "https://v1.102.3.archive.immich.app"
},
{
"label": "v1.102.2",
- "url": "https://v1.102.2.archive.immich.app/"
+ "url": "https://v1.102.2.archive.immich.app"
},
{
"label": "v1.102.1",
- "url": "https://v1.102.1.archive.immich.app/"
+ "url": "https://v1.102.1.archive.immich.app"
},
{
"label": "v1.102.0",
- "url": "https://v1.102.0.archive.immich.app/"
+ "url": "https://v1.102.0.archive.immich.app"
},
{
"label": "v1.101.0",
- "url": "https://v1.101.0.archive.immich.app/"
+ "url": "https://v1.101.0.archive.immich.app"
},
{
"label": "v1.100.0",
- "url": "https://v1.100.0.archive.immich.app/"
+ "url": "https://v1.100.0.archive.immich.app"
}
]