From cce696afe99df34b27848cc31d89ce0f944059a2 Mon Sep 17 00:00:00 2001 From: cemal Date: Mon, 18 Dec 2023 09:38:16 +0100 Subject: [PATCH] Bugfix lowercase uppercase --- src/main/kotlin/main/Form.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/main/Form.kt b/src/main/kotlin/main/Form.kt index 0d1e37b..cd1973b 100644 --- a/src/main/kotlin/main/Form.kt +++ b/src/main/kotlin/main/Form.kt @@ -164,6 +164,9 @@ fun formPage(onCancelClick: () -> Unit) { val wordsList = loadDatasFromFile().toMutableList() + // Transform name to lowercase to avoid duplicates + name.value = name.value.lowercase() + // Verify if the word already exists in the glossary if (wordsList.any { it.name.equals(name.value, ignoreCase = true) }) { println("Le mot '${name.value}' existe déjà dans le glossaire. Ajout annulé.")