mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-09-01 07:04:07 +00:00
bug fix
This commit is contained in:
parent
7e6bfa49ea
commit
b92ff26e81
1 changed files with 14 additions and 7 deletions
|
|
@ -235,13 +235,20 @@ class _ChatMessagesViewState extends State<ChatMessagesView>
|
|||
messages = chatItems.reversed.toList();
|
||||
});
|
||||
|
||||
if (wasSentByMe && itemScrollController.isAttached) {
|
||||
unawaited(
|
||||
itemScrollController.scrollTo(
|
||||
index: 0,
|
||||
duration: const Duration(milliseconds: 150),
|
||||
),
|
||||
);
|
||||
if (wasSentByMe) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted || !itemScrollController.isAttached) return;
|
||||
try {
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue