fallback on default deck in congrats screen

https://forums.ankiweb.net/t/error-when-trying-to-choose-deck-in-new-anki/11829
This commit is contained in:
Damien Elmes 2021-08-04 12:57:46 +10:00
parent 57f3d300bb
commit 94913ec23f

View File

@ -15,8 +15,7 @@ pub(crate) struct CongratsInfo {
impl Collection {
pub fn congrats_info(&mut self) -> Result<pb::CongratsInfoResponse> {
let did = self.get_current_deck_id();
let deck = self.get_deck(did)?.ok_or(AnkiError::NotFound)?;
let deck = self.get_current_deck()?;
let today = self.timing_today()?.days_elapsed;
let info = self.storage.congrats_info(&deck, today)?;
let is_filtered_deck = deck.is_filtered();