From 054c428ba34ac2d575cfd688ac7e31a4af68ab86 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 24 Nov 2016 11:34:14 -0500 Subject: [PATCH] FIX: Don't modify variables when rendering --- .../poll/assets/javascripts/components/poll-voters.js.es6 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/poll/assets/javascripts/components/poll-voters.js.es6 b/plugins/poll/assets/javascripts/components/poll-voters.js.es6 index 7dcca87b861..ef756e20acb 100644 --- a/plugins/poll/assets/javascripts/components/poll-voters.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-voters.js.es6 @@ -40,8 +40,10 @@ export default Ember.Component.extend({ didInsertElement() { this._super(); - this.set("numOfVotersToShow", Math.round(this.$().width() / 25) * 2); - if (this.get("voterIds").length > 0) this._fetchUsers(); + Ember.run.scheduleOnce('afterRender', () => { + this.set("numOfVotersToShow", Math.round(this.$().width() / 25) * 2); + if (this.get("voterIds").length > 0) this._fetchUsers(); + }); }, actions: {