Apply the requested view before first paint via a data-view attribute and CSS, and switch views before loading the library.
This commit is contained in:
1 parent
b45b4437b8
commit
eb8a9bb57b
4 files changed
+34
-1
No files matched your search
+2
-1
@@ -1856,6 +1856,7 @@ function debounce(fn, ms) {
|
||||
|
||||
function switchView(view) {
|
||||
state.view = view;
|
||||
document.documentElement.dataset.view = view;
|
||||
if (view !== "library" && !filtersState.pinned) closeFilters();
|
||||
document.querySelectorAll(".tab").forEach((tab) => {
|
||||
const active = tab.dataset.view === view;
|
||||
@@ -2367,7 +2368,6 @@ if ("serviceWorker" in navigator) {
|
||||
$("#sort").value = state.sort;
|
||||
await Promise.all([loadMeta(), loadMoods()]);
|
||||
pollJob(true);
|
||||
await loadGames(true);
|
||||
|
||||
const params = new URLSearchParams(location.search);
|
||||
if (params.get("view") === "recommend") {
|
||||
@@ -2391,5 +2391,6 @@ if ("serviceWorker" in navigator) {
|
||||
} else if (params.get("view") === "services") {
|
||||
switchView("services");
|
||||
}
|
||||
await loadGames(true);
|
||||
if (params.get("game")) openGame(params.get("game"));
|
||||
})();
|
||||
Reference in new issue
Block a user