From 4c73840d432c883beee29b0427bfdd5a5a90f76e Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sat, 4 Apr 2020 10:35:38 +0200 Subject: [PATCH] NotesCache: Increase its size to 20 With the cards view, we see way more notes. --- lib/core/notes_cache.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/notes_cache.dart b/lib/core/notes_cache.dart index 1d5cef12..a58ef4f4 100644 --- a/lib/core/notes_cache.dart +++ b/lib/core/notes_cache.dart @@ -16,6 +16,8 @@ class NotesCache { final String notesBasePath; final bool enabled = true; + static const CACHE_SIZE = 20; + NotesCache({@required this.filePath, @required this.notesBasePath}); Future load(NotesFolderFS rootFolder) async { @@ -84,7 +86,7 @@ class NotesCache { for (var note in allNotes) { heap.add(note); - if (heap.length > 10) { + if (heap.length > CACHE_SIZE) { heap.removeFirst(); } }