Navigated back handing base
This commit is contained in:
@@ -99,6 +99,9 @@ impl NavigatedPage<DictionaryMessage> for DictionaryState {
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl DictionaryState {
|
||||
|
||||
@@ -41,6 +41,9 @@ impl NavigatedPage<DictionaryQuizMessage> for DictionaryQuizState {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl DictionaryQuizState {
|
||||
|
||||
@@ -23,6 +23,8 @@ impl NavigatedPage<HistoryMessage> for HistoryState {
|
||||
Back => Some(Page::PreviousPage),
|
||||
}
|
||||
}
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl HistoryState {
|
||||
|
||||
@@ -214,6 +214,7 @@ macro_rules! message_navigation {
|
||||
|
||||
pub trait NavigatedPage<T> {
|
||||
fn navigate(&self, message: &T) -> Option<Page>;
|
||||
fn navigated(&mut self);
|
||||
}
|
||||
|
||||
pub trait KeyPressedPage {
|
||||
|
||||
@@ -27,6 +27,9 @@ impl NavigatedPage<QuizMessage> for QuizState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl QuizState {
|
||||
|
||||
@@ -26,6 +26,9 @@ impl NavigatedPage<RandomizerMessage> for RandomizerState {
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for RandomizerState {
|
||||
|
||||
@@ -36,6 +36,9 @@ impl NavigatedPage<RepetitionMessage> for RepetitionState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl RepetitionState {
|
||||
|
||||
@@ -44,6 +44,9 @@ impl NavigatedPage<RepetitionSettingsMessage> for RepetitionSettingsState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl RepetitionSettingsState {
|
||||
|
||||
+8
-1
@@ -58,6 +58,10 @@ impl NavigatedPage<RepetitionsMessage> for RepetitionsState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
self.selected_set = None;
|
||||
}
|
||||
}
|
||||
|
||||
impl RepetitionsState {
|
||||
@@ -273,9 +277,12 @@ impl RepetitionsState {
|
||||
|
||||
if let Some(history) = history {
|
||||
for (date, activity) in history {
|
||||
let distance = *date - now;
|
||||
let distance = now - *date;
|
||||
let index = counts.len() as i64 - distance.num_days() - 1;
|
||||
|
||||
if index == 210 {
|
||||
println!("invalid index")
|
||||
}
|
||||
if index < 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,9 @@ impl NavigatedPage<SelectorMessage> for SelectorState {
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl SelectorState {
|
||||
|
||||
@@ -48,6 +48,9 @@ impl NavigatedPage<SyncMessage> for SyncState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl SyncState {
|
||||
|
||||
@@ -25,6 +25,9 @@ impl NavigatedPage<WordMessage> for WordState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl WordState {
|
||||
|
||||
@@ -26,6 +26,9 @@ impl NavigatedPage<WritingMessage> for WritingState {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl WritingState {
|
||||
|
||||
Reference in New Issue
Block a user