From a3a8bb1eaab501281fd0452239f00a63418d3b10 Mon Sep 17 00:00:00 2001 From: "Rene Vergara A." Date: Wed, 11 Sep 2024 21:34:15 -0400 Subject: [PATCH] rvv041 - AddressBook - empty Address book database case --- src/Zenith/GUI.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Zenith/GUI.hs b/src/Zenith/GUI.hs index 1cf132b..27d21fb 100644 --- a/src/Zenith/GUI.hs +++ b/src/Zenith/GUI.hs @@ -1256,7 +1256,10 @@ handleEvent wenv node model evt = CheckValidAddress a -> [Model $ model & abAddressValid .~ isRecipientValid a] CheckValidDescrip a -> [Model $ model & abDescripValid .~ isValidString a] - ShowAdrBook -> [Model $ model & showAdrBook .~ True & menuPopup .~ False] + ShowAdrBook -> + if null (model ^. abaddressList) + then [Model $ model & newAdrBkEntry .~ True & menuPopup .~ False] + else [Model $ model & showAdrBook .~ True & menuPopup .~ False] CloseAdrBook -> [Model $ model & showAdrBook .~ False] NewAdrBkEntry -> [Model $ model & newAdrBkEntry .~ True & menuPopup .~ False]