Merge branch 'main' into remove-report-user

pull/1384/head
ggurdin 1 year ago committed by GitHub
commit c923ef29f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1108,8 +1108,14 @@ class ChatController extends State<ChatPageWithRoom>
inputFocus.requestFocus();
}
void scrollToEventId(String eventId) async {
final eventIndex = timeline!.events.indexWhere((e) => e.eventId == eventId);
void scrollToEventId(
String eventId, {
bool highlightEvent = true,
}) async {
final eventIndex = timeline!.events
.where((event) => event.isVisibleInGui)
.toList()
.indexWhere((e) => e.eventId == eventId);
if (eventIndex == -1) {
setState(() {
timeline = null;
@ -1125,11 +1131,14 @@ class ChatController extends State<ChatPageWithRoom>
});
return;
}
setState(() {
scrollToEventIdMarker = eventId;
});
if (highlightEvent) {
setState(() {
scrollToEventIdMarker = eventId;
});
}
await scrollController.scrollToIndex(
eventIndex,
eventIndex + 1,
duration: FluffyThemes.animationDuration,
preferPosition: AutoScrollPosition.middle,
);
_updateScrollController();

Loading…
Cancel
Save