()
| 349 | if (method === "push" && typeof window.history.pushState === "function") { |
| 350 | window.history.pushState(null, "", nextUrl); |
| 351 | } else { |
| 352 | window.history.replaceState(null, "", nextUrl); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | function readUrlState() { |
| 357 | const params = new URLSearchParams(window.location.search); |
| 358 | |
| 359 | if (searchInput) { |
| 360 | searchInput.value = params.get("q") ?? ""; |
| 361 | } |
| 362 | |
| 363 | applyCategory(params.get("category") ?? "all"); |
| 364 | applySort(params.get("sort") ?? "featured"); |
| 365 | |
| 366 | const requestedPage = Number.parseInt(params.get("page") ?? "1", 10); |
| 367 | currentPage = |
no test coverage detected