mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-13 01:36:22 +00:00
fix: distance disappears after 10 seconds
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
|
||||
import {PositionService} from '../../../map/position.service';
|
||||
import {Observable, timer} from 'rxjs';
|
||||
import {filter, Observable, timer} from 'rxjs';
|
||||
import {hasValidLocation, isSCFloor, PlaceTypes, PlaceTypesWithDistance} from './place-types';
|
||||
import {map} from 'rxjs/operators';
|
||||
|
||||
@@ -36,7 +36,10 @@ export class PlaceListItemComponent {
|
||||
@Input() set item(item: PlaceTypes) {
|
||||
this._item = item;
|
||||
if (!isSCFloor(item) && hasValidLocation(item)) {
|
||||
this.distance = timer(0, 10_000).pipe(map(() => this.positionService.getDistance(item.geo.point)));
|
||||
this.distance = timer(0, 10_000).pipe(
|
||||
map(() => this.positionService.getDistance(item.geo.point)),
|
||||
filter(it => it !== undefined),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user