Skip to content

Commit

Permalink
Implemented default tissues
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Jan 11, 2025
1 parent 0c4c306 commit 3d39806
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions projects/planner/src/app/shared/dive.schedules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,15 @@ export class DiveSchedules {

public previousDiveTissues(diveId: number): LoadedTissue[] {
if(diveId > 1) {
const previousDiveId = diveId - 1;
const dive = this.byId(previousDiveId);
const previousDive = this.byId(diveId - 1);
const dive = this.byId(diveId);

if(dive) {
return dive.diveResult.finalTissues;
if(previousDive && dive && dive.isRepetitive) {
return previousDive.diveResult.finalTissues;
}
}

// TODO test that throws an error, when trying to build tissues from empty array
// Should be replaced by default tissues
// This is replaced when applying the surface interval
return [];
}

Expand Down

0 comments on commit 3d39806

Please sign in to comment.