decks start collapsed

This commit is contained in:
Damien Elmes 2021-02-02 17:14:11 +10:00
parent 4b7d30f515
commit 7d8448a321
3 changed files with 14 additions and 2 deletions

View file

@ -45,7 +45,11 @@ impl Deck {
name: "".into(),
mtime_secs: TimestampSecs(0),
usn: Usn(0),
common: DeckCommon::default(),
common: DeckCommon {
study_collapsed: true,
browser_collapsed: true,
..Default::default()
},
kind: DeckKind::Normal(norm),
}
}

View file

@ -133,7 +133,11 @@ impl Deck {
name: "".into(),
mtime_secs: TimestampSecs(0),
usn: Usn(0),
common: DeckCommon::default(),
common: DeckCommon {
study_collapsed: true,
browser_collapsed: true,
..Default::default()
},
kind: DeckKind::Filtered(filt),
}
}

View file

@ -35,6 +35,10 @@ impl SqliteStorage {
self.upgrade_tags_to_schema17()?;
self.db.execute_batch("update col set ver = 17")?;
}
// fixme: on the next schema upgrade, change _collapsed to _expanded
// in DeckCommon and invert existing values, so that we can avoid
// serializing the values in the default case, and use
// DeckCommon::default() in new_normal() and new_filtered()
Ok(())
}