Skip to content

Commit

Permalink
Do not set units if undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
eceeeren committed Oct 11, 2024
1 parent cfe507a commit 5eb0fd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h2 id="page-heading">
/>
</div>
</div>
@if (!units || units!.length < 1) {
@if (units!.length < 1) {
<div class="alert alert-danger mt-3">
<fa-icon [icon]="faExclamationTriangle" />
{{ 'artemisApp.attachmentUnit.createAttachmentUnits.noUnitDetected' | artemisTranslate }}
Expand All @@ -109,7 +109,7 @@ <h2 id="page-heading">
[ngbTooltip]="'artemisApp.attachmentUnit.createAttachmentUnits.processTimeInfo' | artemisTranslate"
type="button"
(click)="createAttachmentUnits()"
[disabled]="!units || units!.length < 1"
[disabled]="units!.length < 1"
class="btn btn-primary"
>
<span jhiTranslate="entity.action.submit"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class AttachmentUnitsComponent implements OnInit {
)
.subscribe({
next: (res) => {
this.units = res.body!.units;
this.units = res.body?.units || this.units;
this.numberOfPages = res.body!.numberOfPages;
this.isLoading = false;
},
Expand Down

0 comments on commit 5eb0fd7

Please sign in to comment.