diff --git a/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts b/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts index 6ba27ff8..30479c28 100644 --- a/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts +++ b/src/frontend/app/ui/gallery/grid/grid.gallery.component.ts @@ -405,7 +405,7 @@ export class GalleryGridComponent // so not required to render more, but the scrollbar does not trigger more photos to render // (on lightbox navigation) while ( - (this.mediaToRender.length - 1 < groupIndex && + (this.mediaToRender.length - 1 <= groupIndex || this.mediaToRender[this.mediaToRender.length - 1]?.media?.length < mediaIndex) && this.renderARow() !== null // eslint-disable-next-line no-empty diff --git a/test/cypress/e2e/gallery.cy.ts b/test/cypress/e2e/gallery.cy.ts index 0f95f9d8..e7da8365 100644 --- a/test/cypress/e2e/gallery.cy.ts +++ b/test/cypress/e2e/gallery.cy.ts @@ -81,8 +81,8 @@ describe('Gallery', () => { it('Gallery should auto open lightbox for IMG_1252.jpg', () => { cy.visit('/gallery/?p=IMG_1252.jpg'); - cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); - cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); + cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('This is a super long title with special characters -.,űáéúőpóüö'); + cy.get('app-lightbox-controls .faces-container > .face > .face-name').should('not.exist'); }); }); @@ -118,8 +118,8 @@ describe('Gallery - dont wait for content load', () => { cy.visit('/gallery/?p=IMG_1252.jpg'); - cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); - cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); + cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('This is a super long title with special characters -.,űáéúőpóüö'); + cy.get('app-lightbox-controls .faces-container > .face').should('not.exist'); }); });