Skip to content

Commit

Permalink
Fix notes from default category not shown after update to v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
udenr committed Sep 13, 2024
1 parent d222064 commit d5c5f6b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ class MainActivityViewModel(application: Application) : AndroidViewModel(applica

private fun Flow<List<Note>>.filterCategories(): Flow<List<Note>> {
return this.map {
it.filter { note -> note.category == category.value || category.value == CAT_ALL }
it.filter { note ->
note.category == category.value // Note matches current category
|| category.value == CAT_ALL // We're in the all notes category
|| (category.value == 0 && note.category == -1) // Note is still in old default category (-1). Should still show in new default category (0)
}
}
}

Expand Down

0 comments on commit d5c5f6b

Please sign in to comment.