Skip to content

Commit

Permalink
fix: increment reaction count if cache is not updated (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon authored Aug 26, 2024
1 parent 31db8c1 commit 5b80865
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/provider/notes_notifier_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class NotesNotifier extends _$NotesNotifier {
? '${reaction.substring(0, reaction.length - 1)}@.:'
: reaction;
final cachedNote = state[noteId];
if (cachedNote != null) {
if (cachedNote != null && cachedNote.myReaction != emoji) {
add(
cachedNote.copyWith(
reactionCount: (cachedNote.reactionCount ?? 0) + 1,
Expand Down
2 changes: 1 addition & 1 deletion lib/provider/notes_notifier_provider.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5b80865

Please sign in to comment.