only add non-free text reactions to recent
This commit is contained in:
parent
301bcd94f2
commit
93b832839b
4 changed files with 25 additions and 20 deletions
|
|
@ -36,15 +36,6 @@ extension BuildEventOptions on Event {
|
|||
.watch(PinnedIdsController.provider(roomId))
|
||||
.contains(eventId);
|
||||
|
||||
Future<void> sendReaction(String emoji) async {
|
||||
await ref.watch(notifier).sendReaction(emoji, this).onError(showError);
|
||||
|
||||
await ref
|
||||
.read(RecentEmojiController.provider.notifier)
|
||||
.add(emoji)
|
||||
.onError(showError);
|
||||
}
|
||||
|
||||
void showReasonDialog({
|
||||
required String title,
|
||||
required String description,
|
||||
|
|
@ -116,9 +107,17 @@ extension BuildEventOptions on Event {
|
|||
}.take(4))
|
||||
IconButton(
|
||||
icon: Text(emoji),
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
sendReaction(emoji);
|
||||
await ref
|
||||
.watch(notifier)
|
||||
.sendReaction(emoji, this)
|
||||
.onError(showError);
|
||||
|
||||
await ref
|
||||
.read(RecentEmojiController.provider.notifier)
|
||||
.add(emoji)
|
||||
.onError(showError);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
|
|
@ -133,7 +132,10 @@ extension BuildEventOptions on Event {
|
|||
allowFreeText: true,
|
||||
onSelection: (emoji) {
|
||||
Navigator.of(context).pop();
|
||||
sendReaction(emoji);
|
||||
ref
|
||||
.watch(notifier)
|
||||
.sendReaction(emoji, this)
|
||||
.onError(showError);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -21,12 +21,15 @@ class const EmojiPicker({
|
|||
.watch(upstream.EmojiController.provider)
|
||||
.betterWhen(
|
||||
data: (categories) => upstream.EmojiPicker(
|
||||
onSelection: (emoji) async {
|
||||
onSelection: (emoji, isFreeText) async {
|
||||
await onSelection(emoji);
|
||||
|
||||
if (!isFreeText) {
|
||||
await ref
|
||||
.watch(RecentEmojiController.provider.notifier)
|
||||
.add(emoji)
|
||||
.onError(showError);
|
||||
}
|
||||
},
|
||||
allowFreeText: allowFreeText,
|
||||
prependCategories: .new([
|
||||
|
|
|
|||
|
|
@ -898,10 +898,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: material_emoji_picker
|
||||
sha256: "0468b616b9dc837caf31b3c260f26b31f91ddd21fa5125c1521481e037852657"
|
||||
sha256: "738e70a8d2f592be05dd9889037cc6098a63e0d8c48723125848865ab305f138"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "1.2.0"
|
||||
material_ui:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ dependencies:
|
|||
unifiedpush: 6.2.0
|
||||
unifiedpush_storage_shared_preferences: 1.0.0
|
||||
flutter_local_notifications: 22.3.1
|
||||
material_emoji_picker: 1.1.2
|
||||
material_emoji_picker: 1.2.0
|
||||
xdg_desktop_portal:
|
||||
git:
|
||||
url: https://github.com/Henry-Hiles/xdg_desktop_portal.dart
|
||||
|
|
|
|||
Loading…
Reference in a new issue