about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-08 00:57:13 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-08 00:57:13 +0100
commit5528719bc9fd4e8dca0e5e51de183a6dd27b4d55 (patch)
tree30e615140e1afbe8d7d8986fe4743d1e4aeb7a03 /app/views
parent38e9c66f34d7054357a3de63834f182734d43d75 (diff)
parent3aaac4f134eb092baeb0ba5979bdb3abd702a4ee (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/views')
-rw-r--r--app/views/stream_entries/_poll.html.haml6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/views/stream_entries/_poll.html.haml b/app/views/stream_entries/_poll.html.haml
index dad04b79c..d6b2c0cd9 100644
--- a/app/views/stream_entries/_poll.html.haml
+++ b/app/views/stream_entries/_poll.html.haml
@@ -1,10 +1,8 @@
-- options      = (!poll.expired? && poll.hide_totals?) ? poll.unloaded_options : poll.loaded_options
-- voted        = user_signed_in? && poll.votes.where(account: current_account).exists?
-- show_results = voted || poll.expired?
+- show_results = (user_signed_in? && poll.voted?(current_account)) || poll.expired?
 
 .poll
   %ul
-    - options.each do |option|
+    - poll.loaded_options.each do |option|
       %li
         - if show_results
           - percent = poll.votes_count > 0 ? 100 * option.votes_count / poll.votes_count : 0