chore: Follow up request history
This commit is contained in:
parent
faf1cf42b2
commit
dc64d1679b
1 changed files with 22 additions and 20 deletions
|
|
@ -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 Builder(
|
return const SizedBox.shrink();
|
||||||
builder: (context) {
|
}
|
||||||
|
return Builder(
|
||||||
|
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,23 +99,22 @@ class ChatEventList extends StatelessWidget {
|
||||||
controller.requestHistory,
|
controller.requestHistory,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Center(
|
}
|
||||||
child: AnimatedSwitcher(
|
return Center(
|
||||||
duration: FluffyThemes.animationDuration,
|
child: AnimatedSwitcher(
|
||||||
child: timeline.canRequestHistory
|
duration: FluffyThemes.animationDuration,
|
||||||
? IconButton(
|
child: timeline.canRequestHistory
|
||||||
onPressed: controller.requestHistory,
|
? IconButton(
|
||||||
icon: const Icon(Icons.refresh_outlined),
|
onPressed: controller.requestHistory,
|
||||||
)
|
icon: const Icon(Icons.refresh_outlined),
|
||||||
: const CircularProgressIndicator.adaptive(
|
)
|
||||||
strokeWidth: 2,
|
: const CircularProgressIndicator.adaptive(
|
||||||
),
|
strokeWidth: 2,
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
}
|
);
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
}
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue