More migration code

This commit is contained in:
2026-08-18 12:58:02 +03:00
parent 97c76350e1
commit 9e28b05167
4 changed files with 61 additions and 97 deletions
+10 -15
View File
@@ -27,11 +27,9 @@ use std::sync::{Arc, Mutex};
#[derive(Clone)]
pub struct RepetitionsState {
correct_filters: Vec<bool>,
current_sets_cards_cache: HashMap<usize, (Vec<usize>, Vec<usize>)>,
word_id_index_map: HashMap<u32, usize>,
local_settings: HashMap<u32, DeckLocalSetting>,
view_data: Option<SetViewData>,
view_data: Option<DeckViewData>,
decks: Vec<DeckSettings>,
state: Arc<Mutex<AppState>>,
}
@@ -489,20 +487,17 @@ pub enum RepetitionsMessage {
AppendWords(usize),
}
#[derive(Clone, Default)]
struct DeckLocalSetting {
#[derive(Clone)]
struct DeckViewData {
set_settings: DeckSettings,
existing_words_indices: Option<Vec<usize>>,
available_words_indices: Option<Vec<usize>>,
append_mode: AppendMode,
append_warning: bool,
valid_filter: bool,
index: usize,
}
#[derive(Clone)]
struct SetViewData{
set_local_settings: DeckLocalSetting,
set_settings: DeckSettings,
existing_words_indices: Vec<usize>,
available_words_indices: Vec<usize>,
}
impl Deref for SetViewData {
impl Deref for DeckViewData {
type Target = DeckSettings;
fn deref(&self) -> &Self::Target {