()
| 1533 | } |
| 1534 | |
| 1535 | function syncDateControls() { |
| 1536 | const dateInput = $("paperDate"); |
| 1537 | const daysInput = $("daysInput"); |
| 1538 | const runButton = $("runDailyBtn"); |
| 1539 | if (!dateInput || !daysInput || !runButton) return; |
| 1540 | if (state.dailyPolling) { |
| 1541 | runButton.disabled = true; |
| 1542 | runButton.textContent = ui().papers.backgroundRunning; |
| 1543 | return; |
| 1544 | } |
| 1545 | const today = todayDateValue(); |
| 1546 | if (!dateInput.value) dateInput.value = today; |
| 1547 | if (dateInput.value > today) dateInput.value = today; |
| 1548 | daysInput.value = String(selectedDateFetchDays()); |
| 1549 | runButton.disabled = false; |
| 1550 | runButton.textContent = dateInput.value === today ? ui().papers.pullToday : ui().papers.pullSelected; |
| 1551 | } |
| 1552 | |
| 1553 | function setDailyTaskState(taskId = "", userId = "", polling = false) { |
| 1554 | state.dailyTaskId = taskId || ""; |
no test coverage detected