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

@ -871,17 +871,23 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
if (!mounted) return;
final updatedCounts = response['reactions'] as Map<String, 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) {
setState(() {
_reactionCountsByPost[postId] = updatedCounts
.map((key, value) => MapEntry(key, value as int));
print('DEBUG: Updated local reaction counts: ${_reactionCountsByPost[postId]}');
});
}
if (updatedMine != null) {
setState(() {
_myReactionsByPost[postId] =
updatedMine.map((item) => item.toString()).toSet();
print('DEBUG: Updated local my reactions: ${_myReactionsByPost[postId]}');
});
}
} catch (_) {