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

This commit is contained in:
Santo Shakil
2026-07-21 19:08:45 +05:30
committed by GitHub
parent 7b0f58b2c1
commit e81a79224c
@@ -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();