make relatedEvent store a rowId

This commit is contained in:
Henry Hiles 2026-09-29 15:17:35 -04:00
commit 9bc2d9955a
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
4 changed files with 30 additions and 15 deletions

View file

@ -29,7 +29,7 @@ final class const RoomChat({
}) extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final relatedEvent = useState<Event?>(null);
final relatedEvent = useState<int?>(null);
final relationType = useState(RelationType.reply);
final contextualEvent = useState<int?>(initialHighlight);
final highlightedEvent = useState<int?>(null);
@ -132,8 +132,8 @@ final class const RoomChat({
ref: ref,
roomId: roomId,
userId: userId,
onRelation: (event, type) {
relatedEvent.value = event;
onRelation: (rowId, type) {
relatedEvent.value = rowId;
relationType.value = type;
composerNode.requestFocus();
},
@ -210,7 +210,7 @@ final class const RoomChat({
tags: tags,
relationType: relationType.value,
shouldMention: shouldMention,
relation: relatedEvent.value,
relatedEventRowId: relatedEvent.value,
)
.onError(showError),
relationType: relationType.value,