Skip to content

Commit

Permalink
Merge pull request #35 from petrvecera/playerScore
Browse files Browse the repository at this point in the history
Reverse the data which are calculated
  • Loading branch information
Petr Vecera authored Aug 21, 2017
2 parents 1cd0cca + b5b952d commit dc4ae1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion App/app/view/charts/PlayerVsPlayerViewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ Ext.define('Enif.view.charts.PlayerVsPlayerViewController', {
store.setData(thisStoreData);
}

const matches = gameStore.getData().items;
// reverse the items so the first match is calculated first
const matches = gameStore.getData().items.reverse();
let pushCounter = 0;

for(let i = 0; i < matches.length; i++){
Expand Down
5 changes: 3 additions & 2 deletions App/metadata/view/charts.PlayerVsPlayerViewModel
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
" store.setData(thisStoreData);",
"}",
"",
"const matches = gameStore.getData().items;",
"// reverse the items so the first match is calculated first",
"const matches = gameStore.getData().items.reverse();",
"let pushCounter = 0;",
"",
"for(let i = 0; i < matches.length; i++){",
Expand All @@ -147,7 +148,7 @@
"",
" setTimeout((recordsToShow, wins, loses, draws, score) => {",
"",
" VM.set('numberOfMatches', wins + loses + draws); ",
" VM.set('numberOfMatches', wins + loses + draws);",
" VM.set('wins', wins);",
" VM.set('loses', loses);",
" VM.set('draws', draws);",
Expand Down

0 comments on commit dc4ae1d

Please sign in to comment.