Skip to content

Commit

Permalink
Fix voting, fix sorting, better error handling in log parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
FugiTech committed Aug 21, 2018
1 parent da99f7c commit 84cb4f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ app.post('/vote', (req, res) => {
if (wsByUID.has(token.channel_id)) {
let ws = wsByUID.get(token.channel_id)
let vote = {
ip: req.ip,
ip: token.opaque_user_id,
user: token.user_id,
draftID: req.body.draft_id,
card: req.body.card,
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# esc, :wq, enter, "exit"
# >docker-machine restart

set -e

rm -rf dist
mkdir dist
mkdir dist/twitch
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deckmaster",
"version": "2018.8.20",
"version": "2018.8.21",
"author": "Fugi <Fugiman47@gmail.com>",
"description": "Deckmaster Twitch Extension",
"repository": "github:fugiman/deckmaster",
Expand Down
2 changes: 2 additions & 0 deletions client/src/main/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default class Parser {
end = +m[1]
} else {
console.log('Unexpected error parsing JSON!', e)
this.buffer = this.buffer.substring(1)
return
}
}
Expand Down Expand Up @@ -314,6 +315,7 @@ export default class Parser {
// order of sorts goes from least important -> most important
return _.chain(cards)
.map(c => +c)
.sortBy(c => AllCards.get(c).name)
.sortBy(c => AllCards.get(c).cmc)
.sortBy(c => {
let d = AllCards.get(c)
Expand Down

0 comments on commit 84cb4f8

Please sign in to comment.