Skip to content

Commit

Permalink
Fix bug with empty tank display
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Lebo committed Feb 29, 2024
1 parent 4501eff commit 38ad754
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ export class GasConsumedDifferenceComponent {
for (const tankA of this.profileComparatorService.profileACombinedTanks) {
const tankB: IConsumedMix | undefined = this.profileComparatorService.profileBCombinedTanks
.find(t => t.gas.contentCode() === tankA.gas.contentCode());
if (tankB === undefined) {
emptyTank.gas = tankA.gas.copy();
}
mixedTanks.push({ profileA: tankA, profileB: tankB ?? emptyTank });
}

for (const tankB of this.profileComparatorService.profileBCombinedTanks) {
if (!mixedTanks.find(mt => mt.profileB?.gas.contentCode() === tankB.gas.contentCode()
)){
emptyTank.gas = tankB.gas.copy();
mixedTanks.push({ profileA: emptyTank, profileB: tankB });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="d-flex flex-row">
<div class="img-wrapper"><img src="./assets/icons/legend-safetyReserve.png" alt="Safety reserve"></div>
<div class="d-flex flex-row justify-content-between w-100">
<small *ngIf="gasTotalProfileA != 0" class="text-start text-muted">
<small *ngIf="gasTotalProfileA != 0 else whiteSpace" class="text-start text-muted">
Safety reserve:
{{ gasReserveProfileA | number:'1.0-0' }}/{{ gasTotalProfileA | number:'1.0-0' }} {{units.volume}}
</small>
Expand Down Expand Up @@ -83,3 +83,7 @@
<small class="text-start text-muted">
{{ gasName }} is not present
</small>
</ng-template>
<ng-template #whiteSpace>
<small></small>
</ng-template>

0 comments on commit 38ad754

Please sign in to comment.