rvv001 - Issue 085 - [Zenith GUI] Read a payment URI

Processing Payment URI is working
		     Display of error messages added to process
This commit is contained in:
Rene V. Vergara 2025-01-02 13:41:12 -05:00
parent 6b3ea31882
commit 332b7f5520

View file

@ -273,7 +273,6 @@ buildUI wenv model = widgetTree
[ mainWindow
, confirmOverlay `nodeVisible` isJust (model ^. confirmTitle)
, seedOverlay `nodeVisible` model ^. showSeed
, paymentURIOverlay `nodeVisible` model ^. paymentURIDisplay
, txOverlay `nodeVisible` isJust (model ^. showTx)
, sendTxOverlay `nodeVisible` model ^. openSend
, txIdOverlay `nodeVisible` isJust (model ^. showId)
@ -289,6 +288,7 @@ buildUI wenv model = widgetTree
model ^.
updateABAddress
, showVKOverlay `nodeVisible` model ^. viewingKeyDisplay
, paymentURIOverlay `nodeVisible` model ^. paymentURIDisplay
, pmtUsingURIOverlay `nodeVisible` model ^. usepmtURIOverlay
, shieldOverlay `nodeVisible` model ^. shieldZec
, deShieldOverlay `nodeVisible` model ^. deShieldZec
@ -1735,14 +1735,18 @@ handleEvent wenv node model evt =
--
DisplayPaymentURI -> [ Model $ model & paymentURIDisplay .~ True & uriString .~ "" & menuPopup .~ False]
ClosePaymentURI -> [Model $ model & paymentURIDisplay .~ False]
--
-- Display Pay using URI Form
--
DisplayPayUsingURI -> [ Model $ model & usepmtURIOverlay.~ True & menuPopup .~ False]
ClosePayUsingURI -> [Model $ model & usepmtURIOverlay .~ False]
ProcIfValidURI -> do
[Model $ model & paymentURIDisplay .~ False ]
let zp = parseZcashPayment $ T.unpack (model ^. uriString)
case zp of
Right p -> do
case uriAmount p of
Just a ->
[ Model $ model & paymentURIDisplay .~ False
[ Model $ model & usepmtURIOverlay .~ False
& openSend .~ True
& privacyChoice .~ Full
& recipientValid .~ False
@ -1752,22 +1756,17 @@ handleEvent wenv node model evt =
, Event $ ClosePaymentURI
]
Nothing ->
[ Model $ model & paymentURIDisplay .~ False
[ Model $ model & usepmtURIOverlay .~ False
& openSend .~ False
& uriString .~ ""
, Event $ ShowError "Invalid URI"
]
Left e -> [ Model $ model & paymentURIDisplay .~ False
Left e -> [ Model $ model & usepmtURIOverlay .~ False
& openSend .~ False
& uriString .~ ""
, Event $ ShowError "Invalid URI"
]
--
-- Display Pay using URI Form
--
DisplayPayUsingURI -> [ Model $ model & usepmtURIOverlay.~ True & menuPopup .~ False]
ClosePayUsingURI -> [Model $ model & usepmtURIOverlay .~ False]
--
--
ShowShield ->
if model ^. tBalance > 0