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:
@@ -252,6 +252,8 @@ function Picker() {
|
|||||||
pollStartedAtRef.current = new Date().toISOString();
|
pollStartedAtRef.current = new Date().toISOString();
|
||||||
setPollActive(true);
|
setPollActive(true);
|
||||||
setPollResult(null);
|
setPollResult(null);
|
||||||
|
setPollEndingAt(null);
|
||||||
|
setShowEndPollOptions(false);
|
||||||
try {
|
try {
|
||||||
await api.post(`/sessions/${activeSession.id}/voting/start`);
|
await api.post(`/sessions/${activeSession.id}/voting/start`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user