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
...@@ -51,3 +51,14 @@ errorsViewCpt = here.component "errorsView" cpt ...@@ -51,3 +51,14 @@ errorsViewCpt = here.component "errorsView" cpt
Nothing -> es Nothing -> es
Just es' -> es' Just es' -> es'
) errors ) 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 ...@@ -16,7 +16,8 @@ import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Config.Utils" here = R2.here "Gargantext.Config.Utils"
handleRESTError :: forall a. T.Box (Array FrontendError) handleRESTError :: forall a.
T.Box (Array FrontendError)
-> Either RESTError a -> Either RESTError a
-> (a -> Aff Unit) -> (a -> Aff Unit)
-> Aff Unit -> Aff Unit
......
...@@ -796,6 +796,7 @@ toggleSidePanelState Opened = Closed ...@@ -796,6 +796,7 @@ toggleSidePanelState Opened = Closed
data FrontendError = data FrontendError =
FStringError { error :: String } FStringError { error :: String }
| FRESTError { error :: RESTError } | FRESTError { error :: RESTError }
| FOtherError { error :: String }
derive instance Generic FrontendError _ derive instance Generic FrontendError _
instance Eq FrontendError where eq = genericEq 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