Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix reply state bug in comments section

ashilkn61c2f720291c
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index 285271add7..545d996e4e 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -193,6 +193,7 @@ class _CommentsScreenState extends State<CommentsScreen> {
}
final comment = _comments[index];
return CommentBubbleWidget(
+ key: ValueKey(comment.id),
comment: comment,
isOwnComment: comment.userID == _currentUserID,
currentUserID: _currentUserID,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
index 7e93f28a76..97d93cccc0 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
@@ -45,6 +45,17 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget> {
_loadData();
}
+ @override
+ void didUpdateWidget(CommentBubbleWidget oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (widget.comment.id != oldWidget.comment.id) {
+ _parentComment = null;
+ _reactions = [];
+ _isLiked = false;
+ _loadData();
+ }
+ }
+
Future<void> _loadData() async {
// Load parent if reply
if (widget.comment.isReply && widget.onFetchParent != null) {