Skip to content

Commit

Permalink
fix(indexeddb): set stop on success cursor condition (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced authored Feb 19, 2024
1 parent fee356f commit f2dedc2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm2src/mm2_db/src/indexed_db/drivers/cursor/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ impl CursorDriver {
if matches!(item_action, CursorItemAction::Include) {
if let Some(cursor_condition) = where_ {
if cursor_condition(val.clone())? {
// stop iteration and return value.
self.stopped = true;
return Ok(Some((id, val)));
}
} else {
Expand Down

0 comments on commit f2dedc2

Please sign in to comment.