mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix undo queue being cleared on every error
This only discards the undo and study queues when the error is not a FilteredDeckError
This commit is contained in:
parent
b2ab0c0830
commit
f9c9c8c2ff
1 changed files with 4 additions and 1 deletions
|
@ -44,7 +44,10 @@ impl Collection {
|
|||
})
|
||||
// roll back on error
|
||||
.or_else(|err| {
|
||||
self.discard_undo_and_study_queues();
|
||||
// not necesarry to discard queues for all errors
|
||||
if !matches!(err, AnkiError::FilteredDeckError { .. }) {
|
||||
self.discard_undo_and_study_queues();
|
||||
}
|
||||
if autocommit {
|
||||
self.storage.rollback_trx()?;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue