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:
1 parent
85ff1e3893
commit
b45b4437b8
2 files changed
+6
-3
No files matched your search
+4
-3
@@ -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 (_) {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user