Skip to content

Commit e071f65

Browse files
committed
fix: only redirect on existing versions
1 parent 4842aa6 commit e071f65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/versionSelector/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export function VersionSelector({versions, sdk}: {sdk: string; versions: string[
5757
useEffect(() => {
5858
const pathVersion = getCurrentVersion();
5959
const storedSelection = getLocallyStoredVersion();
60-
if (storedSelection !== null && pathVersion !== storedSelection) {
60+
if (
61+
storedSelection !== null &&
62+
pathVersion !== storedSelection &&
63+
versions.includes(storedSelection)
64+
) {
6165
router.replace(getVersionedPathname(storedSelection));
6266
}
6367
}, [

0 commit comments

Comments
 (0)