Fix transport stats value drop on navigation (CC-88)
parent
006555617a
commit
b73a67df9c
|
@ -26,10 +26,6 @@ export class ScoreboardComponent implements OnChanges {
|
||||||
|
|
||||||
isSteamUUID = PlayerUtils.isSteamUUID;
|
isSteamUUID = PlayerUtils.isSteamUUID;
|
||||||
|
|
||||||
cellHeight = 40;
|
|
||||||
|
|
||||||
columnWidth = 65;
|
|
||||||
|
|
||||||
rows = [];
|
rows = [];
|
||||||
|
|
||||||
sortedRows = [];
|
sortedRows = [];
|
||||||
|
@ -52,11 +48,16 @@ export class ScoreboardComponent implements OnChanges {
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
if (changes.war) {
|
if (changes.war) {
|
||||||
this.war.players.forEach(player => {
|
|
||||||
// meters to kilometer or fill with null, since optional
|
changes.war.currentValue.players
|
||||||
player.travelDistance = player.travelDistance ? Math.round(player.travelDistance / 1000) : 0;
|
.filter(player => !player.initalized)
|
||||||
player.driverDistance = player.driverDistance ? Math.round(player.driverDistance / 1000) : 0;
|
.forEach(player => {
|
||||||
});
|
// meters to kilometer or fill with null, since optional
|
||||||
|
player.travelDistance = player.travelDistance ? Math.round(player.travelDistance / 1000) : 0;
|
||||||
|
player.driverDistance = player.driverDistance ? Math.round(player.driverDistance / 1000) : 0;
|
||||||
|
// mark initialized to avoid processing again on navigation
|
||||||
|
player.initalized = true;
|
||||||
|
});
|
||||||
|
|
||||||
this.rows = changes.war.currentValue.players;
|
this.rows = changes.war.currentValue.players;
|
||||||
this.currentSort.active = 'kill';
|
this.currentSort.active = 'kill';
|
||||||
|
|
Loading…
Reference in New Issue