about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-09-22 14:15:18 +0200
committerThibaut Girka <thib@sitedethib.com>2019-09-30 15:58:29 +0200
commite25b7feb72d0abc5e411fd32749c968041ade182 (patch)
tree5570616f8e91bcacc25ae0300dd8d4df563f51d4 /app/javascript/flavours/glitch/actions
parent2441d07cd5d62aeea7bfa76f5ea4294e863b4bf9 (diff)
[Glitch] Show user what options they have voted
Port front-end changes from b359974d9b356bb723fe046466b178328cf9bbaf to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/actions')
-rw-r--r--app/javascript/flavours/glitch/actions/importer/normalizer.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js
index 52d85c059..b35c4d7bd 100644
--- a/app/javascript/flavours/glitch/actions/importer/normalizer.js
+++ b/app/javascript/flavours/glitch/actions/importer/normalizer.js
@@ -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),
   }));