Skip to content

Commit 918493e

Browse files
Merge branch 'fix-enabling-video-mediaviewer-without-image-mediaviewer-7.2' into fix-enabling-video-mediaviewer-without-image-mediaviewer-main
2 parents a49c8ca + 43dd508 commit 918493e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
1+
import { Component, Input, OnChanges, OnInit } from '@angular/core';
22
import { NgxGalleryImage, NgxGalleryOptions } from '@kolkov/ngx-gallery';
33
import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model';
44
import { 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

Comments
 (0)