From 41d9b324b1ab6b82a1fc46efe550e374a424f7da Mon Sep 17 00:00:00 2001 From: Finn Brewer Date: Thu, 1 Aug 2024 16:10:13 -0700 Subject: [PATCH] feat: include rating words in dashboard ui --- src-tauri/src/stats.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/stats.rs b/src-tauri/src/stats.rs index 7c431f1..01a5055 100644 --- a/src-tauri/src/stats.rs +++ b/src-tauri/src/stats.rs @@ -64,6 +64,8 @@ pub async fn time_spent(state: State<'_, SakinyjeState>) -> Result, @@ -76,7 +78,7 @@ pub async fn get_words_known_at_levels( .get(current_language) .expect("language to include") .words; - let mut words_at_rating = [0; 5]; + let mut words_at_rating = [0; 4]; for info in words.values() { match info.rating { -1 | 0 => (), @@ -89,7 +91,7 @@ pub async fn get_words_known_at_levels( .iter() .enumerate() .map(|(rating, amount)| NumWordsKnown { - name: format!("words rated {}", rating + 1), + name: format!("{} words", WORD_RATING[rating]), amount: *amount, }) .collect())