Fix frontend error when car is not moving yet
This commit is contained in:
parent
d6a44ac1f6
commit
5742d184f2
@ -55,6 +55,9 @@ export class LandingComponent implements OnInit {
|
|||||||
startWith(0),
|
startWith(0),
|
||||||
switchMap(() => this.restService.getCarEvents(vin))
|
switchMap(() => this.restService.getCarEvents(vin))
|
||||||
).subscribe((data: any) => {
|
).subscribe((data: any) => {
|
||||||
|
if (data.body === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const carEvent = data.body as CarEvent;
|
const carEvent = data.body as CarEvent;
|
||||||
const car = this.car_markers.get(vin) as Car;
|
const car = this.car_markers.get(vin) as Car;
|
||||||
car.carEvent = carEvent;
|
car.carEvent = carEvent;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user