Skip to content

High performance self-hosted photo and video management solution.

fix(mobile): stop double close animation when dismissing an asset (#29413)

Santo Shakile81a79224c4c
diff --git a/mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart b/mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart
index abef9ceff8..25f99e2361 100644
--- a/mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart
+++ b/mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart
@@ -174,6 +174,12 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
return;
}
+ // The viewer is closing; don't flip the current asset now. Flipping it swaps
+ // the grid tile hero keys mid pop and animates the close on two tiles (#23779).
+ if (!mounted || !(ModalRoute.of(context)?.isActive ?? true)) {
+ return;
+ }
+
AssetViewer._setAsset(ref, asset);
_preloader.preload(index, context.sizeData);
_handleCasting();