From: Benjamin Auder Date: Thu, 28 Dec 2017 14:39:15 +0000 (+0100) Subject: Fix bug while setting score (pairings component) X-Git-Url: https://git.auder.net/img/css/pieces/assets/current/gitweb.js?a=commitdiff_plain;h=ce0473b4fac73ad9ac63cf8fa480548817349804;p=westcastle.git Fix bug while setting score (pairings component) --- diff --git a/js/index.js b/js/index.js index 02e490e..0d2adad 100644 --- a/js/index.js +++ b/js/index.js @@ -154,8 +154,8 @@ new Vue({ }, setScore: function() { let sortedSessions = this.sessions[this.currentIndex] - .map( (s,i) => { return {value:s, index:i}; }) - .sort( (a,b) => { return parseInt(b.value) - parseInt(a.value); }); + .map( (s,i) => { return {value:parseInt(s), index:i}; }) + .sort( (a,b) => { return b.value - a.value; }); let pdts = [4, 2, 1, 0]; // NOTE: take care of ex-aequos (spread points subtotal) let curSum = 0, curCount = 0, start = 0;