fix: keep HLTB and services tabs on reload
CI / test (push) Successful in 37s

Persist every non-library view in the URL so refreshing ?view=hltb or ?view=services stays on the same tab.
This commit is contained in:
strsv committed 2026-11-07 02:29:48 +03:00
1 parent 85ff1e3893
commit b45b4437b8
2 files changed
+6 -3

No files matched your search

+4 -3
View File
@@ -1872,11 +1872,12 @@ function switchView(view) {
if (view === "friends") loadFriends();
try {
const url = new URL(location.href);
if (view === "recommend" || view === "friends") {
url.searchParams.set("view", view);
} else {
if (view === "library") {
url.searchParams.delete("view");
} else {
url.searchParams.set("view", view);
}
if (view !== "friends") url.searchParams.delete("friend");
history.replaceState(null, "", url);
} catch (_) {}
}