1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Fix media title race condition for browser history #587

This commit is contained in:
Patrik J. Braun 2023-02-26 19:59:07 +01:00
parent 6a165af52f
commit bc0728c282

View File

@ -247,8 +247,11 @@ export class GalleryLightboxComponent implements OnDestroy, OnInit {
public hide(): void {
this.router
.navigate([], {queryParams: this.queryService.getParams()})
.then(() => {
this.piTitleService.setLastNonMedia();
})
.catch(console.error);
this.piTitleService.setLastNonMedia();
}
animatePhoto(from: Dimension, to: Dimension = from): AnimationPlayer {
@ -397,8 +400,11 @@ export class GalleryLightboxComponent implements OnDestroy, OnInit {
this.gridPhotoQL.get(photoIndex).gridMedia.media
),
})
.then(() => {
this.piTitleService.setMediaTitle(this.gridPhotoQL.get(photoIndex).gridMedia);
})
.catch(console.error);
this.piTitleService.setMediaTitle(this.gridPhotoQL.get(photoIndex).gridMedia);
}
private showPhoto(photoIndex: number, resize = true): void {