New repository methods
This commit is contained in:
1 parent
11d5144db5
commit
55bdc5a7ad
5 files changed
+63
-41
No files matched your search
@@ -17,6 +17,7 @@ use log::info;
|
||||
use parking_lot::RwLock;
|
||||
use rusqlite::Connection;
|
||||
use crate::data::repositories::Repository;
|
||||
use crate::data_provider::card_states::CardStateRepository;
|
||||
use crate::data_provider::word_groups::WordGroupRepository;
|
||||
|
||||
pub const USER_FONT: Font = Font::with_name("Noto Sans JP");
|
||||
@@ -65,6 +66,7 @@ pub struct AppState {
|
||||
pub dictionary: WordRepository,
|
||||
pub decks: DeckRepository,
|
||||
pub word_groups: WordGroupRepository,
|
||||
pub card_states: CardStateRepository,
|
||||
pub connection: Arc<RwLock<SqliteConnection>>,
|
||||
pub sync_data: Arc<RwLock<AppSettings>>,
|
||||
pub activity: HashMap<Id, Vec<(NaiveDate, u32)>>,
|
||||
@@ -83,6 +85,7 @@ impl AppState {
|
||||
dictionary: WordRepository::new(connection.clone()),
|
||||
decks: DeckRepository::new(connection.clone()),
|
||||
word_groups: WordGroupRepository::new(connection.clone()),
|
||||
card_states: CardStateRepository::new(connection.clone()),
|
||||
sync_data: Arc::new(RwLock::new(AppSettings {
|
||||
key: None,
|
||||
auto_web_fetch: false,
|
||||
|
||||
Reference in new issue
Block a user