Skip to content

Commit

Permalink
Fix #648
Browse files Browse the repository at this point in the history
  • Loading branch information
shiosyakeyakini-info committed Nov 10, 2024
1 parent 064c549 commit b9ff46a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lib/view/common/misskey_notes/misskey_note.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class MisskeyNote extends HookConsumerWidget {
}

await ref.read(dialogStateNotifierProvider.notifier).guard(() async {
final notesRepository = ref.read(notesProvider(account));
await ref
.read(misskeyPostContextProvider)
.notes
Expand All @@ -143,7 +144,7 @@ class MisskeyNote extends HookConsumerWidget {
const Duration(milliseconds: misskeyHQReactionDelay),
);
}
await ref.read(notesProvider(account)).refresh(displayNote.id);
await notesRepository.refresh(displayNote.id);
return;
});
}
Expand Down Expand Up @@ -349,6 +350,7 @@ class MisskeyNote extends HookConsumerWidget {
if (dialogValue != 0) return;

await ref.read(dialogStateNotifierProvider.notifier).guard(() async {
final notesRepository = ref.read(notesWithProvider);
await ref
.read(misskeyPostContextProvider)
.notes
Expand All @@ -361,7 +363,7 @@ class MisskeyNote extends HookConsumerWidget {
);
}

await ref.read(notesWithProvider).refresh(displayNote.id);
await notesRepository.refresh(displayNote.id);
});

return;
Expand All @@ -387,6 +389,7 @@ class MisskeyNote extends HookConsumerWidget {
true) {
return;
}
final notesRepository = ref.read(notesProvider(account));

await ref
.read(misskeyPostContextProvider)
Expand All @@ -398,7 +401,7 @@ class MisskeyNote extends HookConsumerWidget {
const Duration(milliseconds: misskeyHQReactionDelay),
);
}
await ref.read(notesProvider(account)).refresh(displayNote.id);
await notesRepository.refresh(displayNote.id);
return;
}
final misskey = ref.read(misskeyPostContextProvider);
Expand Down
6 changes: 4 additions & 2 deletions lib/view/common/misskey_notes/reaction_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ReactionButton extends HookConsumerWidget {
if (dialogValue != 0) return;

await ref.read(dialogStateNotifierProvider.notifier).guard(() async {
final notesRepository = ref.read(notesWithProvider);
await ref
.read(misskeyPostContextProvider)
.notes
Expand All @@ -76,7 +77,7 @@ class ReactionButton extends HookConsumerWidget {
);
}

await ref.read(notesWithProvider).refresh(noteId);
await notesRepository.refresh(noteId);
});

return;
Expand All @@ -96,6 +97,7 @@ class ReactionButton extends HookConsumerWidget {
return;
}
await ref.read(dialogStateNotifierProvider.notifier).guard(() async {
final notesRepository = ref.read(notesWithProvider);
await ref.read(misskeyPostContextProvider).notes.reactions.create(
NotesReactionsCreateRequest(
noteId: noteId,
Expand All @@ -110,7 +112,7 @@ class ReactionButton extends HookConsumerWidget {
);
}

await ref.read(notesWithProvider).refresh(noteId);
await notesRepository.refresh(noteId);
});
});

Expand Down

0 comments on commit b9ff46a

Please sign in to comment.