(name)
| 493 | } |
| 494 | |
| 495 | function switchView(name) { |
| 496 | const targetView = $(name); |
| 497 | const targetNav = document.querySelector(`[data-view="${name}"]`); |
| 498 | if (!targetView || !targetNav) return; |
| 499 | document.querySelectorAll(".view").forEach((view) => view.classList.remove("active")); |
| 500 | document.querySelectorAll(".nav-item").forEach((item) => item.classList.remove("active")); |
| 501 | targetView.classList.add("active"); |
| 502 | targetNav.classList.add("active"); |
| 503 | $("pageTitle").textContent = targetNav.textContent; |
| 504 | if (name === "settings") { |
| 505 | runAction(refreshSettings); |
| 506 | } |
| 507 | if (name === "push") { |
| 508 | runAction(loadSourceOptions); |
| 509 | if (!["queued", "running"].includes(state.dailyTaskStatus)) { |
| 510 | runAction(loadLatestPush); |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | function renderUsers(users, preferredUserId = state.userId) { |
| 516 | const select = $("userSelect"); |
no test coverage detected