mirror of
https://github.com/ankitects/anki.git
synced 2026-01-08 03:23:54 -05:00
fixed structure for ninja checks
This commit is contained in:
parent
8a8f07c3c3
commit
9ff49ce111
3 changed files with 36 additions and 32 deletions
|
|
@ -59,11 +59,8 @@ pub enum BoolKey {
|
|||
/// This is a workaround for old clients that used ints to represent boolean
|
||||
/// values. For new config items, prefer using a bool directly.
|
||||
#[derive(Deserialize, Default)]
|
||||
struct BoolLike(
|
||||
#[serde(deserialize_with = "deserialize_bool_from_anything")]
|
||||
#[allow(dead_code)]
|
||||
bool,
|
||||
);
|
||||
struct BoolLike(#[serde(deserialize_with = "deserialize_bool_from_anything")] bool);
|
||||
|
||||
impl Collection {
|
||||
pub fn get_config_bool(&self, key: BoolKey) -> bool {
|
||||
|
|
|
|||
|
|
@ -239,7 +239,14 @@ export function renderReviews(
|
|||
const startDay = Math.floor(d.x0!);
|
||||
// If bin ends at 0, treat it as including day 0 (so use 1 as endDay for dayLabel)
|
||||
// For negative bins, use the bin end directly (dayLabel will handle the conversion)
|
||||
const endDay = d.x1! === 0 ? 1 : d.x1! < 0 ? d.x1! : Math.ceil(d.x1!);
|
||||
let endDay: number;
|
||||
if (d.x1! === 0) {
|
||||
endDay = 1;
|
||||
} else if (d.x1! < 0) {
|
||||
endDay = d.x1!;
|
||||
} else {
|
||||
endDay = Math.ceil(d.x1!);
|
||||
}
|
||||
const day = dayLabel(startDay, endDay);
|
||||
const totals = totalsForBin(d);
|
||||
const dayTotal = valueLabel(sum(totals));
|
||||
|
|
|
|||
Loading…
Reference in a new issue