Skip to content

Commit 81cd999

Browse files
committed
fix(3853): playground resets between version switch
1 parent a9e0b69 commit 81cd999

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/components/starlight/LanguageSelect.astro

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,19 @@ import Select from "@astrojs/starlight/components/Select.astro";
3535
el.addEventListener("change", (e) => {
3636
const value = (e.currentTarget as HTMLSelectElement).value;
3737

38-
let url: URL;
38+
let url = new URL(window.location.href);
3939
switch (value) {
40-
case "next":
41-
url = new URL("https://next.biomejs.dev/");
40+
case "v1":
41+
url.hostname = "v1.biomejs.dev";
4242
break;
43-
case "v2":
44-
url = new URL("https://biomejs.dev/");
43+
case "next":
44+
url.hostname = "next.biomejs.dev";
4545
break;
4646
default:
47-
url = new URL("https://v1.biomejs.dev/");
47+
url.hostname = "biomejs.dev";
4848
break;
4949
}
5050

51-
url.pathname = window.location.pathname;
52-
5351
window.location.href = url.toString();
5452
});
5553
}

0 commit comments

Comments
 (0)