mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-03 05:59:37 +08:00
FlattenedNotesFolder: Always remove the note if present
In the FlattenedNotesFolder we can have a filter to only show certain notes. This is used for showing notes that match some tags. When the note is added to this virtual folder it matches the tag, but later it does not.
This commit is contained in:
@ -71,10 +71,12 @@ class FlattenedNotesFolder with NotesFolderNotifier implements NotesFolder {
|
||||
}
|
||||
|
||||
void _noteRemoved(int _, Note note) {
|
||||
if (filter != null && !filter(note)) {
|
||||
var i = _notes.indexWhere((n) => n.filePath == note.filePath);
|
||||
assert(filter == null ? i != -1 : true);
|
||||
|
||||
if (i == -1) {
|
||||
return;
|
||||
}
|
||||
var i = _notes.indexWhere((n) => n.filePath == note.filePath);
|
||||
assert(i != -1);
|
||||
|
||||
_notes.removeAt(i);
|
||||
|
Reference in New Issue
Block a user