1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Small bugfixes

This commit is contained in:
Patrik J. Braun 2023-09-11 23:55:52 +02:00
parent 3383e155bf
commit 577a3ea480
2 changed files with 8 additions and 4 deletions

View File

@ -24,8 +24,12 @@ export class BlogService {
const dates = content.mediaGroups.map(g => g.date)
.filter(d => !!d).map(d => d.getTime());
const firstMedia = content.mediaGroups[0].media.reduce((p, m) =>
Math.min(m.metadata.creationDate, p), Number.MAX_SAFE_INTEGER);
let firstMedia = Number.MAX_SAFE_INTEGER;
if (content.mediaGroups.length > 0) {
firstMedia = content.mediaGroups[0].media.reduce((p, m) =>
Math.min(m.metadata.creationDate, p), Number.MAX_SAFE_INTEGER);
}
const files = this.mdFilesFilterPipe.transform(content.metaFile)
.map(f => this.splitMarkDown(f, dates, firstMedia));

View File

@ -177,11 +177,11 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
this.prevZoom = this.zoom;
}
tap($event: { tapCount: number }): void {
tap($event: Event): void {
if (!this.activePhoto || this.activePhoto.gridMedia.isVideo()) {
return;
}
if ($event.tapCount < 2) {
if (($event as unknown as { tapCount: number }).tapCount < 2) {
return;
}