[Glitch] Show user what options they have voted

Port front-end changes from b359974d9b to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
ThibG
2019-09-22 14:15:18 +02:00
committed by Thibaut Girka
parent 2441d07cd5
commit e25b7feb72
3 changed files with 16 additions and 4 deletions

View File

@ -71,8 +71,9 @@ export function normalizePoll(poll) {
const emojiMap = makeEmojiMap(normalPoll);
normalPoll.options = poll.options.map(option => ({
normalPoll.options = poll.options.map((option, index) => ({
...option,
voted: poll.own_votes && poll.own_votes.includes(index),
title_emojified: emojify(escapeTextContentForBrowser(option.title), emojiMap),
}));