diff options
author | ThibG <thib@sitedethib.com> | 2019-09-22 14:15:18 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-09-22 14:15:18 +0200 |
commit | b359974d9b356bb723fe046466b178328cf9bbaf (patch) | |
tree | bf8cb3887286aaced76a46ab80c7e250afbb763e /app/javascript/mastodon/actions/importer/normalizer.js | |
parent | 26b810561a5b7cfd1766699358d998b5882a5876 (diff) |
Show user what options they have voted (#11195)
* Add own_votes field to poll results in REST API Fixes #10679 * Display user votes in WebUI * Update styling * Add vote checkmark to public pages
Diffstat (limited to 'app/javascript/mastodon/actions/importer/normalizer.js')
-rw-r--r-- | app/javascript/mastodon/actions/importer/normalizer.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js index 5e7e78e69..f7108fdb9 100644 --- a/app/javascript/mastodon/actions/importer/normalizer.js +++ b/app/javascript/mastodon/actions/importer/normalizer.js @@ -73,8 +73,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), })); |