Partial dictionary rewrite
This commit is contained in:
1 parent
1509947cb0
commit
f2035ca749
12 files changed
+304
-363
No files matched your search
+7
-5
@@ -1,5 +1,5 @@
|
||||
use crate::app::AppState;
|
||||
use crate::data::entities::WordData;
|
||||
use crate::data::entities::{EntityHandle, WordData};
|
||||
use crate::data_provider::words::{delete_word, update_word};
|
||||
use crate::navigation::Page::PreviousPage;
|
||||
use crate::navigation::{NavigatedPage, Page, RootMessage};
|
||||
@@ -16,8 +16,7 @@ use std::sync::Arc;
|
||||
#[derive(Clone)]
|
||||
pub struct WordState {
|
||||
state: AppState,
|
||||
index: usize,
|
||||
word: WordData,
|
||||
handle: EntityHandle<WordData>,
|
||||
}
|
||||
|
||||
impl NavigatedPage<WordMessage> for WordState {
|
||||
@@ -136,8 +135,11 @@ impl NavigatedPage<WordMessage> for WordState {
|
||||
}
|
||||
|
||||
impl WordState {
|
||||
pub(crate) fn new(word: WordData, index: usize, state: AppState) -> WordState {
|
||||
WordState { state, index, word }
|
||||
pub fn new(handle: EntityHandle<WordData>, state: AppState) -> Self {
|
||||
Self{
|
||||
state,
|
||||
handle,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user