Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
feat: update recentViews list to only keep the first 20 items (#4512)
Lucas.Xu72a23bfe82b2
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/recent_folder/mobile_home_recent_views.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/recent_folder/mobile_home_recent_views.dartindex 0ff2b11fe9..95e4f6e11a 100644--- a/frontend/appflowy_flutter/lib/mobile/presentation/home/recent_folder/mobile_home_recent_views.dart+++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/recent_folder/mobile_home_recent_views.dart@@ -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();