NotesCache: Increase its size to 20

With the cards view, we see way more notes.
This commit is contained in:
Vishesh Handa
2020-04-04 10:35:38 +02:00
parent 0524ce665f
commit 4c73840d43

View File

@ -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();
}
}