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:
mcostn 2025-09-03 20:52:19 +03:00
parent b2ab0c0830
commit f9c9c8c2ff

View file

@ -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 {