Commit 23be8199 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev-searx-parser' of git.sr.ht:~cgenie/purescript-gargantext into dev-searx-parser

parents 225d7853 93834b1e
Pipeline #2232 canceled with stage
......@@ -51,3 +51,14 @@ errorsViewCpt = here.component "errorsView" cpt
Nothing -> es
Just es' -> es'
) errors
showError errors i (FOtherError { error }) =
RB.alert { dismissible: true
, onClose
, variant: "danger" } [ H.text $ show error ]
where
onClose = do
here.log2 "click!" error
T.modify_ (\es -> case deleteAt i es of
Nothing -> es
Just es' -> es'
) errors
......@@ -16,7 +16,8 @@ import Toestand as T
here :: R2.Here
here = R2.here "Gargantext.Config.Utils"
handleRESTError :: forall a. T.Box (Array FrontendError)
handleRESTError :: forall a.
T.Box (Array FrontendError)
-> Either RESTError a
-> (a -> Aff Unit)
-> Aff Unit
......
......@@ -796,6 +796,7 @@ toggleSidePanelState Opened = Closed
data FrontendError =
FStringError { error :: String }
| FRESTError { error :: RESTError }
| FOtherError { error :: String }
derive instance Generic FrontendError _
instance Eq FrontendError where eq = genericEq
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment