Navigated back handing base

This commit is contained in:
2026-08-06 23:20:14 +03:00
parent c34b43a800
commit 0d9aaaea24
13 changed files with 41 additions and 1 deletions
+3
View File
@@ -99,6 +99,9 @@ impl NavigatedPage<DictionaryMessage> for DictionaryState {
} }
None None
} }
fn navigated(&mut self) {
}
} }
impl DictionaryState { impl DictionaryState {
+3
View File
@@ -41,6 +41,9 @@ impl NavigatedPage<DictionaryQuizMessage> for DictionaryQuizState {
_ => None, _ => None,
} }
} }
fn navigated(&mut self) {
}
} }
impl DictionaryQuizState { impl DictionaryQuizState {
+2
View File
@@ -23,6 +23,8 @@ impl NavigatedPage<HistoryMessage> for HistoryState {
Back => Some(Page::PreviousPage), Back => Some(Page::PreviousPage),
} }
} }
fn navigated(&mut self) {
}
} }
impl HistoryState { impl HistoryState {
+1
View File
@@ -214,6 +214,7 @@ macro_rules! message_navigation {
pub trait NavigatedPage<T> { pub trait NavigatedPage<T> {
fn navigate(&self, message: &T) -> Option<Page>; fn navigate(&self, message: &T) -> Option<Page>;
fn navigated(&mut self);
} }
pub trait KeyPressedPage { pub trait KeyPressedPage {
+3
View File
@@ -27,6 +27,9 @@ impl NavigatedPage<QuizMessage> for QuizState {
None None
} }
} }
fn navigated(&mut self) {
}
} }
impl QuizState { impl QuizState {
+3
View File
@@ -26,6 +26,9 @@ impl NavigatedPage<RandomizerMessage> for RandomizerState {
} }
None None
} }
fn navigated(&mut self) {
}
} }
impl Default for RandomizerState { impl Default for RandomizerState {
+3
View File
@@ -36,6 +36,9 @@ impl NavigatedPage<RepetitionMessage> for RepetitionState {
None None
} }
} }
fn navigated(&mut self) {
}
} }
impl RepetitionState { impl RepetitionState {
+3
View File
@@ -44,6 +44,9 @@ impl NavigatedPage<RepetitionSettingsMessage> for RepetitionSettingsState {
None None
} }
} }
fn navigated(&mut self) {
}
} }
impl RepetitionSettingsState { impl RepetitionSettingsState {
+8 -1
View File
@@ -58,6 +58,10 @@ impl NavigatedPage<RepetitionsMessage> for RepetitionsState {
None None
} }
} }
fn navigated(&mut self) {
self.selected_set = None;
}
} }
impl RepetitionsState { impl RepetitionsState {
@@ -273,9 +277,12 @@ impl RepetitionsState {
if let Some(history) = history { if let Some(history) = history {
for (date, activity) in history { for (date, activity) in history {
let distance = *date - now; let distance = now - *date;
let index = counts.len() as i64 - distance.num_days() - 1; let index = counts.len() as i64 - distance.num_days() - 1;
if index == 210 {
println!("invalid index")
}
if index < 0 { if index < 0 {
continue; continue;
} }
+3
View File
@@ -61,6 +61,9 @@ impl NavigatedPage<SelectorMessage> for SelectorState {
} }
None None
} }
fn navigated(&mut self) {
}
} }
impl SelectorState { impl SelectorState {
+3
View File
@@ -48,6 +48,9 @@ impl NavigatedPage<SyncMessage> for SyncState {
None None
} }
} }
fn navigated(&mut self) {
}
} }
impl SyncState { impl SyncState {
+3
View File
@@ -25,6 +25,9 @@ impl NavigatedPage<WordMessage> for WordState {
None None
} }
} }
fn navigated(&mut self) {
}
} }
impl WordState { impl WordState {
+3
View File
@@ -26,6 +26,9 @@ impl NavigatedPage<WritingMessage> for WritingState {
None None
} }
} }
fn navigated(&mut self) {
}
} }
impl WritingState { impl WritingState {