[poll-view] Added toast when voting in hidden-results poll.

This commit is contained in:
23rd
2026-03-20 15:16:56 +03:00
parent 39ce6a1a0a
commit c992e883b5
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -6853,6 +6853,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_polls_results_in_days#other" = "results in {count} days";
"lng_polls_ends_in_time" = "ends in {time}";
"lng_polls_results_in_time" = "results in {time}";
"lng_polls_results_after_close" = "Results will appear after the poll ends.";
"lng_polls_retract" = "Retract vote";
"lng_polls_stop" = "Stop poll";
"lng_polls_stop_warning" = "If you stop this poll now, nobody will be able to vote in it anymore. This action cannot be undone.";
@@ -1331,6 +1331,13 @@ void Poll::updateVotes() {
for (auto &answer : _answers) {
answer.selected = false;
}
if (_votedFromHere
&& (_flags & PollData::Flag::HideResultsUntilClose)
&& !(_flags & PollData::Flag::Closed)) {
_parent->delegate()->elementShowTooltip(
{ tr::lng_polls_results_after_close(tr::now) },
[] {});
}
} else {
_votedFromHere = false;
_hasSelected = false;