From f71bae55a01dc3ee09c0bc731729aafdab64df3c Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Wed, 10 Apr 2024 11:45:04 +0200 Subject: [PATCH] Prevent empty new domain labels. --- src/App/Page/DomainList.purs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App/Page/DomainList.purs b/src/App/Page/DomainList.purs index 88ba0be..c187243 100644 --- a/src/App/Page/DomainList.purs +++ b/src/App/Page/DomainList.purs @@ -253,17 +253,17 @@ handleAction = case _ of { newDomainForm } <- H.get let new_domain = build_new_domain newDomainForm.new_domain newDomainForm.selected_domain - case newDomainForm._errors, new_domain of - _, "" -> + case newDomainForm.new_domain, newDomainForm._errors, new_domain of + "", _, _ -> H.raise $ Log $ UnableToSend "You didn't enter the new domain!" - [], _ -> do + _, [], _ -> do message <- H.liftEffect $ DNSManager.serialize $ DNSManager.MkNewDomain { domain: new_domain } H.raise $ MessageToSend message H.raise $ Log $ SystemLog $ "Add a new domain (" <> new_domain <> ")" handleAction $ HandleNewDomainInput $ INP_newdomain "" - _, _ -> + _, _, _ -> H.raise $ Log $ UnableToSend $ "The new domain name is invalid." handleQuery :: forall a m. MonadAff m => Query a -> H.HalogenM State Action () Output m (Maybe a)