You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-13 07:00:55 +02:00
* concat location properties and use URL constructor to fix issues * remove slashes from old version urls * remove versions 1.125.0 and 1.125.4 that don't have docs archives
This commit is contained in:
@ -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',
|
||||
}))}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user