FIX: Sort is destructive and that is not what we want.

This commit is contained in:
Guo Xiang Tan 2017-01-16 23:41:41 +08:00
parent 74d73f9e06
commit 115a1c8680
1 changed files with 2 additions and 2 deletions

View File

@ -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) {