diff --git a/src/blocks/file-blocks/poll.tsx b/src/blocks/file-blocks/poll.tsx index 2c20a67..2afd773 100644 --- a/src/blocks/file-blocks/poll.tsx +++ b/src/blocks/file-blocks/poll.tsx @@ -20,9 +20,11 @@ export default function (props: FileBlockProps) { const onClick = (index: number) => { if (!isEditable) return; - const newPoll = { ...poll }; - newPoll.options[index].votes += 1; - onUpdateContent(JSON.stringify(newPoll)); + return () => { + const newPoll = { ...poll }; + newPoll.options[index].votes += 1; + onUpdateContent(JSON.stringify(newPoll)); + }; }; if (!poll || !poll.options)