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 loggedin : boolean ;
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
@@ -30,9 +31,7 @@ export class MediaViewerImageComponent implements OnChanges, OnInit {
3031
3132 constructor ( private authService : AuthService ) { }
3233
33- ngOnChanges ( changes : SimpleChanges ) : void {
34- this . image = changes . image . currentValue ;
35- this . preview = changes . preview . currentValue ;
34+ ngOnChanges ( ) : void {
3635 this . galleryOptions = [
3736 {
3837 preview : this . preview !== undefined ? this . preview : true ,
@@ -63,6 +62,7 @@ export class MediaViewerImageComponent implements OnChanges, OnInit {
6362
6463 ngOnInit ( ) : void {
6564 this . isAuthenticated$ = this . authService . isAuthenticated ( ) ;
65+ this . ngOnChanges ( ) ;
6666 }
6767
6868 /**
0 commit comments