1
0
Fork 0
forked from Nexus/nexus

show messages whilst sending

This commit is contained in:
Henry Hiles 2026-05-26 12:07:43 -04:00
commit b836c3b06e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
5 changed files with 51 additions and 35 deletions

View file

@ -44,12 +44,16 @@ class RoomChatController extends AsyncNotifier<IList<Event>> {
loadOlder();
}
return room.timeline
return IMap<int, int?>.fromValues(
keyMapper: (id) => 9999999 + (id ?? 0),
values: room.sticky,
)
.addAll(room.timeline)
.toEntryIList(compare: (a, b) => (b?.key ?? 0).compareTo(a?.key ?? 0))
.map((entry) {
if (entry.value == null) return null;
final foundEvent = room.events[entry.value!];
final foundEvent = entry.value == null
? null
: room.events[entry.value!];
final editedEvent =
foundEvent == null || foundEvent.lastEditRowId == 0
@ -153,23 +157,17 @@ class RoomChatController extends AsyncNotifier<IList<Event>> {
),
);
// TODO: Add new event to timeline whilst its sending
// ref
// .watch(RoomsController.provider.notifier)
// .update(
// {
// roomId: Room(
// events: [event].toIList(),
// timeline: [
// TimelineRowTuple(
// timelineRowId: event.timelineRowId,
// eventRowId: event.rowId,
// ),
// ].toIList(),
// ),
// }.toIMap(),
// const ISet.empty(),
// );
ref
.watch(RoomsController.provider.notifier)
.update(
{
roomId: Room(
events: {event.rowId: event}.toIMap(),
sticky: {event.rowId}.toISet(),
),
}.toIMap(),
const ISet.empty(),
);
}
Future<void> removeReaction(