mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: update recentViews list to only keep the first 20 items (#4512)
This commit is contained in:
parent
ed78cb4efc
commit
72a23bfe82
@ -25,9 +25,12 @@ class _MobileRecentFolderState extends State<MobileRecentFolder> {
|
||||
child: BlocBuilder<RecentViewsBloc, RecentViewsState>(
|
||||
builder: (context, state) {
|
||||
final ids = <String>{};
|
||||
final List<ViewPB> recentViews = state.views.reversed.toList();
|
||||
|
||||
List<ViewPB> recentViews = state.views.reversed.toList();
|
||||
recentViews.retainWhere((element) => ids.add(element.id));
|
||||
// only keep the first 10 items.
|
||||
|
||||
// only keep the first 20 items.
|
||||
recentViews = recentViews.take(20).toList();
|
||||
|
||||
if (recentViews.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
|
Loading…
Reference in New Issue
Block a user