forked from TWS/kalkutago
Remove a bit of cruft
This commit is contained in:
parent
741429630b
commit
9e16306c61
|
@ -18,12 +18,6 @@ export const state = reactive({
|
|||
source.addEventListener('TickAdded', event => {
|
||||
console.log(event)
|
||||
const tick: Tick = JSON.parse(event.data)
|
||||
// for (const track of this.tracks) {
|
||||
// if (track.id === tick.track_id) {
|
||||
// console.debug('pushing tick')
|
||||
// track.ticks?.push(tick)
|
||||
// }
|
||||
// }
|
||||
const tracks = this.tracks.map(track => {
|
||||
if (track.id === tick.track_id) {
|
||||
const ticks = track.ticks ?? []
|
||||
|
@ -33,22 +27,17 @@ export const state = reactive({
|
|||
}
|
||||
return track
|
||||
})
|
||||
console.debug(tracks)
|
||||
this.tracks = tracks
|
||||
})
|
||||
source.addEventListener('TickDropped', event => {
|
||||
console.log(event)
|
||||
const tick: Tick = JSON.parse(event.data)
|
||||
// for (const track of this.tracks)
|
||||
// if (track.id === tick.track_id)
|
||||
// track.ticks = track.ticks?.filter($tick => $tick.id === tick.id)
|
||||
const tracks = this.tracks.map(track => {
|
||||
if (track.id === tick.track_id) {
|
||||
track.ticks = track.ticks?.filter($tick => $tick.id !== tick.id)
|
||||
}
|
||||
return track
|
||||
})
|
||||
console.debug(tracks)
|
||||
this.tracks = tracks
|
||||
})
|
||||
source.addEventListener('Lagged', event => {
|
||||
|
|
Loading…
Reference in a new issue