1- import { Component , Input , OnChanges , OnInit , SimpleChanges } from '@angular/core' ;
1+ import { Component , Input , OnChanges , OnInit } from '@angular/core' ;
22import { NgxGalleryImage , NgxGalleryOptions } from '@kolkov/ngx-gallery' ;
33import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model' ;
44import { NgxGalleryAnimation } from '@kolkov/ngx-gallery' ;
@@ -20,8 +20,9 @@ export class MediaViewerImageComponent implements OnChanges, OnInit {
2020
2121 thumbnailPlaceholder = './assets/images/replacement_image.svg' ;
2222
23- galleryOptions : NgxGalleryOptions [ ] ;
24- galleryImages : NgxGalleryImage [ ] ;
23+ galleryOptions : NgxGalleryOptions [ ] = [ ] ;
24+
25+ galleryImages : NgxGalleryImage [ ] = [ ] ;
2526
2627 /**
2728 * Whether or not the current user is authenticated
@@ -33,9 +34,7 @@ export class MediaViewerImageComponent implements OnChanges, OnInit {
3334 ) {
3435 }
3536
36- ngOnChanges ( changes : SimpleChanges ) : void {
37- this . image = changes . image . currentValue ;
38- this . preview = changes . preview . currentValue ;
37+ ngOnChanges ( ) : void {
3938 this . galleryOptions = [
4039 {
4140 preview : this . preview !== undefined ? this . preview : true ,
@@ -66,6 +65,7 @@ export class MediaViewerImageComponent implements OnChanges, OnInit {
6665
6766 ngOnInit ( ) : void {
6867 this . isAuthenticated$ = this . authService . isAuthenticated ( ) ;
68+ this . ngOnChanges ( ) ;
6969 }
7070
7171 /**
0 commit comments