()
| 195 | }, []); |
| 196 | |
| 197 | async function refreshChallenges() { |
| 198 | const list = await api.listChallenges(); |
| 199 | setChallenges(list.challenges); |
| 200 | if (!activeChallengeId && list.challenges[0]) { |
| 201 | setActiveChallengeId(list.challenges[0].id); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | const activeChallenge = challenges.find((item) => item.id === activeChallengeId); |
| 206 | const challengePage = view === "challenge"; |