CT-30 BUG: Forcetracker clear button removes login token #14

Merged
mitch merged 1 commits from bugfix/CT-36/btn-continues-removing-on-mobile into master 2022-03-23 13:04:59 +00:00

View File

@ -100,10 +100,11 @@ export class ArmyDetailComponent implements OnInit {
if (unit && unit.id && unit.unitPowerLevel && this.forceAddedOrNot(unit.id)) { if (unit && unit.id && unit.unitPowerLevel && this.forceAddedOrNot(unit.id)) {
this.forcePoints = this.forcePoints - unit.unitPowerLevel; this.forcePoints = this.forcePoints - unit.unitPowerLevel;
const index = this.getForceUnitIndex(unit); const index = this.getForceUnitIndex(unit);
if (index) { if (index !== null) {
this.forceUnitList.splice(index, 1); this.forceUnitList.splice(index, 1);
} }
} }
console.log(this.forceUnitList);
localStorage.setItem('forceAddedListStored', JSON.stringify(this.forceUnitList)); localStorage.setItem('forceAddedListStored', JSON.stringify(this.forceUnitList));
return this.forcePoints; return this.forcePoints;
} }