Commit 3f6b58fd authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] unsafePartial error fix

parent ca62568f
......@@ -281,7 +281,6 @@ performAction (ShareNode username) p@{ reload: (_ /\ setReload)
do
void $ share session id $ ShareValue {text:username}
-------
performAction (AddNode name nodeType) p@{ openNodes: (_ /\ setOpenNodes)
, reload: (_ /\ setReload)
......@@ -319,8 +318,6 @@ performAction (LinkNode n1 n2) p@{session} = do
void $ linkNodeReq session n1 n2
performAction RefreshTree p
-------
performAction RefreshTree { reload: (_ /\ setReload) } = do
liftEffect $ setReload (_ + 1)
......
......@@ -3,7 +3,7 @@ module Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar where
import Gargantext.Prelude
import Data.Int (fromNumber)
import Data.Maybe (Maybe(..), fromJust)
import Data.Maybe (Maybe(..), maybe)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff, launchAff_)
......@@ -65,7 +65,9 @@ asyncProgressBarCpt = R.hooksComponent "G.C.F.T.N.PB.asyncProgressBar" cpt
pure $ progressIndicator { barType, label: id, progress: toInt progress }
toInt :: Number -> Int
toInt n = unsafePartial $ fromJust $ fromNumber n
toInt n = case fromNumber n of
Nothing -> 0
Just x -> x
type ProgressIndicatorProps =
( barType :: BarType
......
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