mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 19:36:25 +08:00
NotesCache: Increase its size to 20
With the cards view, we see way more notes.
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user