From 115a1c8680db8a4d0cbb8b0459f0048dce258552 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 16 Jan 2017 23:41:41 +0800 Subject: [PATCH] FIX: Sort is destructive and that is not what we want. --- plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 index e6d961a5629..843278f7001 100644 --- a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 +++ b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 @@ -135,10 +135,10 @@ createWidget('discourse-poll-standard-results', { html(attrs) { const { poll } = attrs; const options = poll.get('options'); - if (options) { + if (options) { const voters = poll.get('voters'); - const ordered = options.sort((a, b) => { + const ordered = _.clone(options).sort((a, b) => { if (a.votes < b.votes) { return 1; } else if (a.votes === b.votes) {