chore: Adjust styles and animations

This commit is contained in:
Christian Kußowski 2026-03-12 12:03:03 +01:00
commit 9724b852bb
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 644 additions and 749 deletions

View file

@ -462,21 +462,18 @@ class ChatController extends State<ChatPageWithRoom>
scrollUpBannerEventId = eventId;
});
bool firstUpdateReceived = false;
void updateView() {
if (!mounted) return;
setReadMarker();
setState(() {});
setState(() {
firstUpdateReceived = true;
});
}
Future<void>? loadTimelineFuture;
int? animateInEventIndex;
void onInsert(int i) {
// setState will be called by updateView() anyway
if (timeline?.allowNewEvent == true) animateInEventIndex = i;
}
Future<void> _getTimeline({String? eventContextId}) async {
await Matrix.of(context).client.roomsLoading;
await Matrix.of(context).client.accountDataLoading;
@ -489,15 +486,11 @@ class ChatController extends State<ChatPageWithRoom>
timeline = await room.getTimeline(
onUpdate: updateView,
eventContextId: eventContextId,
onInsert: onInsert,
);
} catch (e, s) {
Logs().w('Unable to load timeline on event ID $eventContextId', e, s);
if (!mounted) return;
timeline = await room.getTimeline(
onUpdate: updateView,
onInsert: onInsert,
);
timeline = await room.getTimeline(onUpdate: updateView);
if (!mounted) return;
if (e is TimeoutException || e is IOException) {
_showScrollUpMaterialBanner(eventContextId!);