Routing to history page

This commit is contained in:
2026-07-05 01:58:32 +03:00
parent ef4773d724
commit 848d376cf8
3 changed files with 14 additions and 7 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ use HistoryMessage::Back;
#[derive(Clone)]
pub struct HistoryState {
set_id: u32,
set_id: usize,
list: Vec<HistoryItem>,
}
@@ -25,7 +25,7 @@ impl NavigatedPage<HistoryMessage> for HistoryState {
}
impl HistoryState {
pub fn new(id: u32, state: Arc<Mutex<AppState>>) -> Self {
pub fn new(id: usize, state: Arc<Mutex<AppState>>) -> Self {
Self {
set_id: id,
list: get_history_of_set(id, &state.lock().unwrap().dictionary),
@@ -55,7 +55,7 @@ impl HistoryState {
}
}
fn get_history_of_set(id: u32, words: &Vec<WordData>) -> Vec<HistoryItem> {
fn get_history_of_set(id: usize, words: &Vec<WordData>) -> Vec<HistoryItem> {
let app_dir = app_data_dir();
let head = app_dir.clone().join(format!("set_{}_history.csv", id));
let tail = app_dir.clone().join(format!("set_{}_history.csv", id));