Correctly apply 'min' updates in polls.

This commit is contained in:
John Preston 2020-01-24 10:31:18 +03:00
parent 2f9db1d069
commit 5aacf867cd
1 changed files with 2 additions and 3 deletions

View File

@ -168,13 +168,12 @@ bool PollData::applyResultToAnswers(
answer->chosen = voters.is_chosen(); answer->chosen = voters.is_chosen();
changed = true; changed = true;
} }
}
if (!isMinResults || closed()) {
if (answer->correct != voters.is_correct()) { if (answer->correct != voters.is_correct()) {
answer->correct = voters.is_correct(); answer->correct = voters.is_correct();
changed = true; changed = true;
} }
} else if (const auto existing = answerByOption(option)) {
answer->chosen = existing->chosen;
answer->correct = existing->correct;
} }
return changed; return changed;
}); });