This commit is contained in:
otsmr 2026-08-03 23:18:33 +02:00
parent 7e6bfa49ea
commit b92ff26e81

View file

@ -235,13 +235,20 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
messages = chatItems.reversed.toList(); messages = chatItems.reversed.toList();
}); });
if (wasSentByMe && itemScrollController.isAttached) { if (wasSentByMe) {
unawaited( WidgetsBinding.instance.addPostFrameCallback((_) {
itemScrollController.scrollTo( if (!mounted || !itemScrollController.isAttached) return;
index: 0, try {
duration: const Duration(milliseconds: 150), unawaited(
), itemScrollController.scrollTo(
); index: 0,
duration: const Duration(milliseconds: 150),
),
);
} catch (_) {
// Ignore if the inner scroll controller is still not attached
}
});
} }
final items = await MemoryItem.convertFromMessages(storedMediaFiles); final items = await MemoryItem.convertFromMessages(storedMediaFiles);