Skip to content

Commit

Permalink
Remove passingNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
chancehudson committed Apr 7, 2019
1 parent 6e8e404 commit e9588ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ export default class Home extends React.Component<{
.passingsByRaceId(this.state.activeRaceId)
.map((passing, index) => (
<div key={index}>
{passing.passingNumber} - {passing.transponder} -{' '}
{passing.date.toString()}
{passing.transponder} - {passing.date.toString()}
</div>
))}
</RootCell>
Expand Down
2 changes: 0 additions & 2 deletions src/stores/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import EventEmitter from 'events'
const MIN_PROTOCOL_VERSION = '2.0'

interface Passing {
passingNumber: number
transponder: string
date: Date
riderId: string
Expand Down Expand Up @@ -91,7 +90,6 @@ export default class DecoderStore extends EventEmitter {
'YYYY-MM-DD;HH:mm:ss:SSS'
).toDate()
this.emit('passing', {
passingNumber: +passingNumber,
date,
transponder,
})
Expand Down
5 changes: 4 additions & 1 deletion src/stores/passing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export default class PassingStore {
raceId,
},
})
this._passingsByRaceId[raceId] = data.sort((p1, p2) => p1.passingNumber - p2.passingNumber)
this._passingsByRaceId[raceId] = data.sort((p1, p2) => {
if (p1.date > p2.date) return 1
return -1
})
} catch (err) {
console.log('Error loading passings', err)
throw err
Expand Down

0 comments on commit e9588ce

Please sign in to comment.