mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
PERF: Paginate public polls.
This commit is contained in:
@ -6,7 +6,6 @@ export default Ember.Controller.extend({
|
||||
isRandom : Ember.computed.equal("poll.order", "random"),
|
||||
isClosed: Ember.computed.equal("poll.status", "closed"),
|
||||
isPublic: Ember.computed.equal("poll.public", "true"),
|
||||
pollsVoters: Ember.computed.alias("post.polls_voters"),
|
||||
|
||||
// shows the results when
|
||||
// - poll is closed
|
||||
@ -152,10 +151,6 @@ export default Ember.Controller.extend({
|
||||
|
||||
this.setProperties({ vote: votes, showResults: true });
|
||||
this.set("model", Em.Object.create(poll));
|
||||
|
||||
if (poll.public) {
|
||||
this.get("pollsVoters")[currentUser.get("id")] = currentUser;
|
||||
}
|
||||
}).catch(() => {
|
||||
bootbox.alert(I18n.t("poll.error_while_casting_votes"));
|
||||
}).finally(() => {
|
||||
|
Reference in New Issue
Block a user