Skip to content

Commit

Permalink
fix: add haptic feedback for long press
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Nov 9, 2024
1 parent ceff6f7 commit e938d13
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/view/widget/note_footer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ class _AddReactionButton extends ConsumerWidget {

return GestureDetector(
onLongPress: (note.reactionCount ?? 0) > 0
? () => showModalBottomSheet<void>(
? () {
if (note.id.isEmpty) return;
HapticFeedback.lightImpact();
showModalBottomSheet<void>(
context: context,
builder: (context) => ReactionUsersSheet(
account: account,
Expand All @@ -474,7 +477,8 @@ class _AddReactionButton extends ConsumerWidget {
),
clipBehavior: Clip.antiAlias,
isScrollControlled: true,
)
);
}
: null,
child: IconButton(
tooltip: (note.reactionCount ?? 0) <= 0
Expand Down Expand Up @@ -561,6 +565,7 @@ class _RemoveReactionButton extends ConsumerWidget {
return GestureDetector(
onLongPress: () {
if (note.id.isEmpty) return;
HapticFeedback.lightImpact();
showModalBottomSheet<void>(
context: context,
builder: (context) => ReactionUsersSheet(
Expand Down

0 comments on commit e938d13

Please sign in to comment.