Fix bug while setting score (pairings component)
authorBenjamin Auder <benjamin.auder@somewhere>
Thu, 28 Dec 2017 14:39:15 +0000 (15:39 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Thu, 28 Dec 2017 14:39:15 +0000 (15:39 +0100)
js/index.js

index 02e490e..0d2adad 100644 (file)
@@ -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;