Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix favorite icon not updating when swiping between files

ashilkn112a08f8be5c
diff --git a/mobile/apps/photos/lib/ui/viewer/file_details/favorite_widget.dart b/mobile/apps/photos/lib/ui/viewer/file_details/favorite_widget.dart
index d2260fe8fd..b6cc625e8e 100644
--- a/mobile/apps/photos/lib/ui/viewer/file_details/favorite_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file_details/favorite_widget.dart
@@ -47,6 +47,7 @@ class _FavoriteWidgetState extends State<FavoriteWidget> {
setState(() {
_isFavorite = isFavorite;
});
+ _updateAnimationState();
}
}
@@ -79,11 +80,15 @@ class _FavoriteWidgetState extends State<FavoriteWidget> {
void _setInitialAnimationState() {
if (_isFavorite == null || _hasSetInitialState) return;
_hasSetInitialState = true;
+ _updateAnimationState();
+ }
+ void _updateAnimationState() {
+ if (_isFavorite == null || _stateMachine == null) return;
if (_isFavorite!) {
- _stateMachine?.trigger("Filled")?.fire();
+ _stateMachine!.trigger("Filled")?.fire();
} else {
- _stateMachine?.trigger("Stroke")?.fire();
+ _stateMachine!.trigger("Stroke")?.fire();
}
}