From 4e983506f9823c8c5a443e72e7a0b0cdfaae7d4f Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sat, 9 Nov 2024 20:00:18 +0100 Subject: [PATCH] New error message for signature algorithms accepting an unique nb of chars. --- src/App/DisplayErrors.purs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App/DisplayErrors.purs b/src/App/DisplayErrors.purs index 8fa0273..10ff86d 100644 --- a/src/App/DisplayErrors.purs +++ b/src/App/DisplayErrors.purs @@ -1,7 +1,7 @@ -- | This module provides functions to display errors in a fancy way. module App.DisplayErrors where -import Prelude (show, ($), (<>)) +import Prelude (show, ($), (<>), (==)) -- import Data.Foldable as Foldable import Data.Maybe (Maybe(..), maybe) @@ -60,7 +60,9 @@ error_to_paragraph v = Bulma.error_message (Bulma.p $ show_error_title v) show_error_key_sizes :: forall w i. Int -> Int -> HH.HTML w i show_error_key_sizes min max - = Bulma.p $ "Chosen signature algorithm only accepts public key input between " + = if min == max + then Bulma.p $ "Chosen signature algorithm only accepts public key input of " <> show min <> " characters." + else Bulma.p $ "Chosen signature algorithm only accepts public key input between " <> show min <> " and " <> show max <> " characters." -- | `show_error_title` provide a simple title string to display to the user in case of an error with an entry.