fix: clear stale pollEndingAt state when starting a new poll

After a countdown-based poll end, pollEndingAt could remain set as a
stale value during the optimistic update in handleStartPolling, causing
the new poll to briefly render in the "Poll Ending" state with 0:00.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cottongin
2026-05-10 21:05:59 -04:00
parent 26ce643351
commit 1d7395e121

View File

@@ -252,6 +252,8 @@ function Picker() {
pollStartedAtRef.current = new Date().toISOString();
setPollActive(true);
setPollResult(null);
setPollEndingAt(null);
setShowEndPollOptions(false);
try {
await api.post(`/sessions/${activeSession.id}/voting/start`);
} catch (err) {