Command Palette

Search for a command to run...

Hectal
Phase 15: Interviews and Capstone
AI Frontend · Exercise 5 of 6 PreviousNext
Advanced

Show the Daily Limit

This Mitra uses useChat. The server allows 2 questions and then answers 429 with a retry-after header of 90. Today the page shows nothing special when that happens.

In the transport's fetch wrapper, notice the 429, read the header, and show Daily limit reached. Try again in 2 minutes. in #error (the wait in whole minutes, rounded up). Also disable #prompt and #send from then on.

What Check tests

  1. Two questions get answers
  2. The third question shows the wait in #error
  3. After the limit, the box and the button are disabled

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.