mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
show deck description on congrats screen
This commit is contained in:
parent
d3ea9b3532
commit
3839ed2e28
3 changed files with 10 additions and 0 deletions
|
@ -1166,6 +1166,7 @@ message CongratsInfoOut {
|
|||
bool have_user_buried = 6;
|
||||
bool is_filtered_deck = 7;
|
||||
bool bridge_commands_supported = 8;
|
||||
string deck_description = 9;
|
||||
}
|
||||
|
||||
message UnburyCardsInCurrentDeckIn {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
use crate::backend_proto as pb;
|
||||
use crate::decks::DeckKind;
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -21,6 +22,11 @@ impl Collection {
|
|||
let today = self.timing_today()?.days_elapsed;
|
||||
let info = self.storage.congrats_info(&deck, today)?;
|
||||
let is_filtered_deck = deck.is_filtered();
|
||||
let deck_description = if let DeckKind::Normal(normal) = &deck.kind {
|
||||
normal.description.clone()
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
let secs_until_next_learn = ((info.next_learn_due as i64)
|
||||
- self.learn_ahead_secs() as i64
|
||||
- TimestampSecs::now().0)
|
||||
|
@ -34,6 +40,7 @@ impl Collection {
|
|||
is_filtered_deck,
|
||||
secs_until_next_learn,
|
||||
bridge_commands_supported: true,
|
||||
deck_description,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,5 +61,7 @@
|
|||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{@html info.deckDescription}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue