diff --git a/packages/frontend/src/retro/components/buttons/ImportRetroMenuItem.tsx b/packages/frontend/src/retro/components/buttons/ImportRetroMenuItem.tsx index 42778cf5..1cc76f64 100644 --- a/packages/frontend/src/retro/components/buttons/ImportRetroMenuItem.tsx +++ b/packages/frontend/src/retro/components/buttons/ImportRetroMenuItem.tsx @@ -29,7 +29,7 @@ export function ImportRetroMenuItem() { participants: {}, waitingList: {}, isVotingEnabled: false, - cardVotingLimit: Number.MAX_VALUE, + cardVotingLimit: 1, timerStatus: TimerStatus.STOPPED, timerDuration: 0, }; diff --git a/packages/frontend/src/retro/components/dialogs/ManageVotesDialog.tsx b/packages/frontend/src/retro/components/dialogs/ManageVotesDialog.tsx index 8f6ab2f3..cdaf92fd 100644 --- a/packages/frontend/src/retro/components/dialogs/ManageVotesDialog.tsx +++ b/packages/frontend/src/retro/components/dialogs/ManageVotesDialog.tsx @@ -27,7 +27,9 @@ export function ManageVotesDialog({ isOpen, close }: DialogProps) { handleCardVotingLimitChanged, } = useRetroContext(); const [voteCount, setVoteCount] = useState(retroState.maxVoteCount); - const [isVotingPerCardLimited, setIsVotingPerCardLimited] = useState(true); + const [isMaxVotesPerCardLimited, setIsMaxVotesPerCardLimited] = useState( + retroState.cardVotingLimit === 1 + ); function handleCancel() { setVoteCount(retroState.maxVoteCount); @@ -39,13 +41,13 @@ export function ManageVotesDialog({ isOpen, close }: DialogProps) { } function handleVotingLimitChange(event: ChangeEvent) { - setIsVotingPerCardLimited(event.target.checked); + setIsMaxVotesPerCardLimited(event.target.checked); } function handleStart() { handleChangeMaxVote(voteCount); handleIsVotingEnabledChanged(true); - handleCardVotingLimitChanged(isVotingPerCardLimited ? 1 : Number.MAX_VALUE); + handleCardVotingLimitChanged(isMaxVotesPerCardLimited ? 1 : Number.MAX_VALUE); close(); } @@ -85,7 +87,9 @@ export function ManageVotesDialog({ isOpen, close }: DialogProps) { Everybody has {voteCount} votes } + control={ + + } label="Maximum one vote per card" /> diff --git a/packages/frontend/src/retro/context/RetroContext.tsx b/packages/frontend/src/retro/context/RetroContext.tsx index 3a5d6825..40e786e2 100644 --- a/packages/frontend/src/retro/context/RetroContext.tsx +++ b/packages/frontend/src/retro/context/RetroContext.tsx @@ -232,7 +232,6 @@ export function RetroContextProvider(props: RetroContextProviderProps) { } function handleCardVotingLimitChanged(limit: number) { - console.log("Voting changed to ", limit); dispatchAndBroadcast({ type: "CARD_VOTING_LIMIT_CHANGED", limit }); }