From 5b8086505f1ef6f1fbcce8d853b6e904b67e4700 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:39:39 +0900 Subject: [PATCH] fix: increment reaction count if cache is not updated (#371) --- lib/provider/notes_notifier_provider.dart | 2 +- lib/provider/notes_notifier_provider.g.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/provider/notes_notifier_provider.dart b/lib/provider/notes_notifier_provider.dart index bbc7ce8e..7c851ae3 100644 --- a/lib/provider/notes_notifier_provider.dart +++ b/lib/provider/notes_notifier_provider.dart @@ -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, diff --git a/lib/provider/notes_notifier_provider.g.dart b/lib/provider/notes_notifier_provider.g.dart index f9e3d9a7..4cf25c18 100644 --- a/lib/provider/notes_notifier_provider.g.dart +++ b/lib/provider/notes_notifier_provider.g.dart @@ -6,7 +6,7 @@ part of 'notes_notifier_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$notesNotifierHash() => r'8560d6797d38ea88f86e8f9b6039f7f4eff3ebd3'; +String _$notesNotifierHash() => r'56e736a66b8b319aaf9ad8320152e25028c5d897'; /// Copied from Dart SDK class _SystemHash {