mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix(mobile): mounted check in ThumbnailTile hero flight listener (#28451)
When the user pops back from the asset viewer mid-flight, the hero animation can fire its status listener after _ThumbnailTileState has been disposed. setState then throws a null check on State._element. Guard the listener with `if (!mounted) return;` — same pattern as #28300 in the album sync action.
This commit is contained in:
@@ -120,6 +120,9 @@ class _ThumbnailTileState extends ConsumerState<ThumbnailTile> {
|
|||||||
},
|
},
|
||||||
flightShuttleBuilder: (context, animation, direction, from, to) {
|
flightShuttleBuilder: (context, animation, direction, from, to) {
|
||||||
void animationStatusListener(AnimationStatus status) {
|
void animationStatusListener(AnimationStatus status) {
|
||||||
|
if (!mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final heroInFlight = status == AnimationStatus.forward || status == AnimationStatus.reverse;
|
final heroInFlight = status == AnimationStatus.forward || status == AnimationStatus.reverse;
|
||||||
if (_hideIndicators != heroInFlight) {
|
if (_hideIndicators != heroInFlight) {
|
||||||
setState(() => _hideIndicators = heroInFlight);
|
setState(() => _hideIndicators = heroInFlight);
|
||||||
|
|||||||
Reference in New Issue
Block a user