chore: Follow up request history

This commit is contained in:
Christian Kußowski 2025-12-03 09:04:31 +01:00
commit dc64d1679b
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -84,9 +84,12 @@ class ChatEventList extends StatelessWidget {
// Request history button or progress indicator: // Request history button or progress indicator:
if (i == events.length + 1) { if (i == events.length + 1) {
if (controller.activeThreadId == null) { if (controller.activeThreadId != null) {
return const SizedBox.shrink();
}
return Builder( return Builder(
builder: (context) { builder: (context) {
if (timeline.canRequestHistory) {
final visibleIndex = timeline.events.lastIndexWhere( final visibleIndex = timeline.events.lastIndexWhere(
(event) => (event) =>
!event.isCollapsedState && event.isVisibleInGui, !event.isCollapsedState && event.isVisibleInGui,
@ -96,6 +99,7 @@ class ChatEventList extends StatelessWidget {
controller.requestHistory, controller.requestHistory,
); );
} }
}
return Center( return Center(
child: AnimatedSwitcher( child: AnimatedSwitcher(
duration: FluffyThemes.animationDuration, duration: FluffyThemes.animationDuration,
@ -112,8 +116,6 @@ class ChatEventList extends StatelessWidget {
}, },
); );
} }
return const SizedBox.shrink();
}
i--; i--;
// The message at this index: // The message at this index: