Add debug logging to _persistReaction to track API response data

This commit is contained in:
Patrick Britton 2026-02-01 13:13:08 -06:00
parent 558272c9a2
commit 681b5b85f9

View file

@ -872,16 +872,22 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
final updatedCounts = response['reactions'] as Map<String, dynamic>?; final updatedCounts = response['reactions'] as Map<String, dynamic>?;
final updatedMine = response['my_reactions'] as List<dynamic>?; final updatedMine = response['my_reactions'] as List<dynamic>?;
print('DEBUG: Toggle reaction response: $response');
print('DEBUG: updatedCounts: $updatedCounts');
print('DEBUG: updatedMine: $updatedMine');
if (updatedCounts != null) { if (updatedCounts != null) {
setState(() { setState(() {
_reactionCountsByPost[postId] = updatedCounts _reactionCountsByPost[postId] = updatedCounts
.map((key, value) => MapEntry(key, value as int)); .map((key, value) => MapEntry(key, value as int));
print('DEBUG: Updated local reaction counts: ${_reactionCountsByPost[postId]}');
}); });
} }
if (updatedMine != null) { if (updatedMine != null) {
setState(() { setState(() {
_myReactionsByPost[postId] = _myReactionsByPost[postId] =
updatedMine.map((item) => item.toString()).toSet(); updatedMine.map((item) => item.toString()).toSet();
print('DEBUG: Updated local my reactions: ${_myReactionsByPost[postId]}');
}); });
} }
} catch (_) { } catch (_) {