mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00: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:
parent
6c64a6dab8
commit
16266c9f5a
2 changed files with 17 additions and 22 deletions
|
|
@ -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',
|
||||
}))}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue