davemart-in / tablechamp-app

Table Sports Leaderboard App (FireBase back-end)
https://tablechamptest.web.app
MIT License
74 stars 39 forks source link

Total games not record not accurate - some games not being saved. #7

Open mgrpowers opened 6 years ago

mgrpowers commented 6 years ago

It appears when a doubles match is played, the record of 1 or more players is not saved. I haven't dug into the logging yet.

Josh-Arment commented 5 years ago

Full disclosure: I have no idea what I'm doing.

That said, I believe lines 758-765 in js/source/tablechamp.js are responsible for the error.

For example, line 758 reads var t1p1GamesLost = localData.playersByKey[t1p1Key].singles_lost;

I believe line 758 should read var t1p1GamesLost = localData.playersByKey[t1p1Key].doubles_lost;

I implemented similar changes (replacing singles_lost with doubles_lost) in lines 758-765 in js/source/tablechamp.js and that seems to have resolved the issue.