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

This commit is contained in:
Santo Shakil 2026-07-21 19:38:45 +06:00 committed by GitHub
parent 7b0f58b2c1
commit e81a79224c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();