Don't POST if no choices set in poll

This commit is contained in:
Lim Chee Aun 2023-02-24 23:38:59 +08:00
parent b7f80fb621
commit 45950da714

View file

@ -951,6 +951,7 @@ function Poll({
choices.push(value); choices.push(value);
} }
}); });
if (!choices.length) return;
setUIState('loading'); setUIState('loading');
await votePoll(choices); await votePoll(choices);
setUIState('default'); setUIState('default');