Check original_deck_id rather than original_deck()

in card_due_str() as we don't necessarily have to load that deck.
This commit is contained in:
RumovZ 2021-03-20 18:12:00 +01:00
parent 1ab0d4dff8
commit af90bbf879

View file

@ -11,7 +11,7 @@ use crate::i18n::{tr_args, I18n, TR};
use crate::{ use crate::{
card::{Card, CardID, CardQueue, CardType}, card::{Card, CardID, CardQueue, CardType},
collection::Collection, collection::Collection,
decks::Deck, decks::{Deck, DeckID},
notes::Note, notes::Note,
notetype::{CardTemplate, NoteType, NoteTypeKind}, notetype::{CardTemplate, NoteType, NoteTypeKind},
scheduler::{timespan::time_span, timing::SchedTimingToday}, scheduler::{timespan::time_span, timing::SchedTimingToday},
@ -207,7 +207,7 @@ impl<'a> RowContext<'a> {
} }
fn card_due_str(&mut self) -> Result<String> { fn card_due_str(&mut self) -> Result<String> {
Ok(if self.original_deck()?.is_some() { Ok(if self.card.original_deck_id != DeckID(0) {
self.i18n.tr(TR::BrowsingFiltered).into() self.i18n.tr(TR::BrowsingFiltered).into()
} else if self.card.queue == CardQueue::New || self.card.ctype == CardType::New { } else if self.card.queue == CardQueue::New || self.card.ctype == CardType::New {
self.i18n.trn( self.i18n.trn(