Routing to history page
This commit is contained in:
+3
-3
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user