Fix repetition display bug and history find bug

This commit is contained in:
micialware committed 2026-08-20 00:49:49 +03:00
1 parent 3661173bb0
commit 44644500b5
11 files changed
+17 -24

No files matched your search

+3 -9
View File
@@ -9,8 +9,8 @@ use iced::alignment::Horizontal::Center;
use iced::widget::space::horizontal;
use iced::widget::*;
use iced::{Element, Fill, FillPortion, Task};
use std::sync::Arc;
use parking_lot::Mutex;
use std::sync::Arc;
#[derive(Clone)]
pub struct HistoryState {
@@ -52,14 +52,8 @@ impl HistoryState {
let history = get_history_of_set(id);
let words = history
.iter()
.map(|item| {
state
.dictionary
.iter()
.find(|w| w.id == item.word_id)
.unwrap()
.clone()
})
.filter_map(|item| state.dictionary.iter().find(|w| w.id == item.word_id))
.cloned()
.collect();
Self {