chore: Follow up highlight event on room open
This commit is contained in:
parent
8ae8dbe45e
commit
5f9aa94339
1 changed files with 10 additions and 5 deletions
|
|
@ -293,7 +293,7 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
if (timeline?.events.any((event) => event.eventId == fullyRead) ??
|
if (timeline?.events.any((event) => event.eventId == fullyRead) ??
|
||||||
false) {
|
false) {
|
||||||
Logs().v('Scroll up to visible event', fullyRead);
|
Logs().v('Scroll up to visible event', fullyRead);
|
||||||
scrollToEventId(fullyRead);
|
scrollToEventId(fullyRead, highlightEvent: false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
|
@ -901,7 +901,10 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
inputFocus.requestFocus();
|
inputFocus.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void scrollToEventId(String eventId) async {
|
void scrollToEventId(
|
||||||
|
String eventId, {
|
||||||
|
bool highlightEvent = true,
|
||||||
|
}) async {
|
||||||
final eventIndex = timeline!.events
|
final eventIndex = timeline!.events
|
||||||
.where((event) => event.isVisibleInGui)
|
.where((event) => event.isVisibleInGui)
|
||||||
.toList()
|
.toList()
|
||||||
|
|
@ -921,9 +924,11 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setState(() {
|
if (highlightEvent) {
|
||||||
scrollToEventIdMarker = eventId;
|
setState(() {
|
||||||
});
|
scrollToEventIdMarker = eventId;
|
||||||
|
});
|
||||||
|
}
|
||||||
await scrollController.scrollToIndex(
|
await scrollController.scrollToIndex(
|
||||||
eventIndex + 1,
|
eventIndex + 1,
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue