AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6
@@ -472,9 +472,13 @@ class BoardViewModel(
|
|||||||
* correct-until-a-moment-ago content, and flashing it empty would be a worse
|
* correct-until-a-moment-ago content, and flashing it empty would be a worse
|
||||||
* lie than showing it one frame stale.
|
* lie than showing it one frame stale.
|
||||||
*
|
*
|
||||||
* Search results are left alone — they are the answer to a query, not a live
|
* While a search is running the QUERY is re-run rather than the board's
|
||||||
* view, and re-running the board query underneath them would replace the hits
|
* destination — running `load` here would replace the hits with the whole
|
||||||
* with the whole board.
|
* board, which is why this branch exists at all. It used to keep the existing
|
||||||
|
* list instead, and that was right for a note whose place in the pile changed
|
||||||
|
* and wrong for one that left it: trashing a hit left the card sitting there,
|
||||||
|
* with a snackbar saying it was gone, until the query happened to re-run
|
||||||
|
* (#3111). Re-asking is still the answer to the query, just a current one.
|
||||||
*/
|
*/
|
||||||
private fun mutate(
|
private fun mutate(
|
||||||
closeEditor: Boolean = false,
|
closeEditor: Boolean = false,
|
||||||
@@ -486,10 +490,8 @@ class BoardViewModel(
|
|||||||
try {
|
try {
|
||||||
val updated = withContext(Dispatchers.IO) { block(core) }
|
val updated = withContext(Dispatchers.IO) { block(core) }
|
||||||
val notes =
|
val notes =
|
||||||
if (state.searching) {
|
withContext(Dispatchers.IO) {
|
||||||
state.notes
|
if (state.searching) core.searchNotes(state.query) else load(state.destination)
|
||||||
} else {
|
|
||||||
withContext(Dispatchers.IO) { load(state.destination) }
|
|
||||||
}
|
}
|
||||||
// On IO, not here: re-deriving the alarm reads every note
|
// On IO, not here: re-deriving the alarm reads every note
|
||||||
// that carries a reminder, and this line runs on the main
|
// that carries a reminder, and this line runs on the main
|
||||||
|
|||||||
Reference in New Issue
Block a user