Apply 1 suggestion(s) to 1 file(s)

This commit is contained in:
Krille Fear 2022-02-15 11:47:22 +00:00 committed by Christian Pauly
commit 0f448af5dc
7 changed files with 98 additions and 69 deletions

View file

@ -834,16 +834,22 @@ class ChatController extends State<Chat> {
if (response == OkCancelResult.ok) {
final events = room!.pinnedEventIds
..removeWhere((oldEvent) => oldEvent == eventId);
room!.setPinnedEvents(events);
showFutureLoadingDialog(
context: context,
future: () => room!.setPinnedEvents(events),
);
}
}
void pinEvent() {
room!.setPinnedEvents(
<String>{
...room!.pinnedEventIds,
...selectedEvents.map((e) => e.eventId),
}.toList(),
showFutureLoadingDialog(
context: context,
future: () => room!.setPinnedEvents(
<String>{
...room!.pinnedEventIds,
...selectedEvents.map((e) => e.eventId),
}.toList(),
),
);
}