()
| 1133 | } |
| 1134 | |
| 1135 | async function refreshDashboard() { |
| 1136 | const userId = activeUser(); |
| 1137 | if (!userId) return; |
| 1138 | const [activity, push] = await Promise.allSettled([ |
| 1139 | api(`/api/activity?user_id=${encodeURIComponent(userId)}&days=14`), |
| 1140 | api(`/api/latest-push?user_id=${encodeURIComponent(userId)}`), |
| 1141 | ]); |
| 1142 | if (push.status === "fulfilled" && push.value.push) { |
| 1143 | $("latestPushStat").textContent = push.value.push.papers.length; |
| 1144 | } |
| 1145 | if (activity.status === "fulfilled") { |
| 1146 | state.activity = activity.value.activity || []; |
| 1147 | renderActivity(state.activity); |
| 1148 | } |
| 1149 | } |
| 1150 | |
| 1151 | function renderActivity(items) { |
| 1152 | renderActivityList("historyList", items, $("activityFilter") ? $("activityFilter").value : ""); |
no test coverage detected