mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 12:23:44 +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 String notesBasePath;
|
||||||
final bool enabled = true;
|
final bool enabled = true;
|
||||||
|
|
||||||
|
static const CACHE_SIZE = 20;
|
||||||
|
|
||||||
NotesCache({@required this.filePath, @required this.notesBasePath});
|
NotesCache({@required this.filePath, @required this.notesBasePath});
|
||||||
|
|
||||||
Future load(NotesFolderFS rootFolder) async {
|
Future load(NotesFolderFS rootFolder) async {
|
||||||
@ -84,7 +86,7 @@ class NotesCache {
|
|||||||
|
|
||||||
for (var note in allNotes) {
|
for (var note in allNotes) {
|
||||||
heap.add(note);
|
heap.add(note);
|
||||||
if (heap.length > 10) {
|
if (heap.length > CACHE_SIZE) {
|
||||||
heap.removeFirst();
|
heap.removeFirst();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user