Skip to content

Commit e5f4a6d

Browse files
committed
check if files are array
1 parent 22907c6 commit e5f4a6d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/app/item-page/simple/field-components/preview-section/preview-section.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ng-container *ngIf="(listOfFiles | async) as files; else loading">
22
<!-- Show "No files" message -->
3-
<div *ngIf="files.length === 0" class="text-center text-muted my-3">
3+
<div *ngIf="isArrayAndEmpty(files) && files.length === 0" class="text-center text-muted my-3">
44
{{ 'item.view.box.no-files.message' | translate }}
55
</div>
66

src/app/item-page/simple/field-components/preview-section/preview-section.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ export class PreviewSectionComponent implements OnInit {
3232
});
3333
}
3434

35-
35+
isArrayAndEmpty(value: unknown): boolean {
36+
return Array.isArray(value) && value.length === 0;
37+
}
3638
}

0 commit comments

Comments
 (0)