Commit e2122393 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge branch 'reload-on-upload' into dev-merge

parents 00850750 5fdc6225
......@@ -88,7 +88,7 @@ toHtml :: R.State Reload
-> Maybe AppRoute
-> R.State OpenNodes
-> R.Element
toHtml reload tree@(NTree (LNode {id, name, nodeType}) ary) tasks@(asyncTasks /\ setAsyncTasks) session frontends mCurrentRoute openNodes = R.createElement el {} []
toHtml reload@(_ /\ setReload) tree@(NTree (LNode {id, name, nodeType}) ary) tasks@(asyncTasks /\ setAsyncTasks) session frontends mCurrentRoute openNodes = R.createElement el {} []
where
el = R.hooksComponent "NodeView" cpt
pAction = performAction session tree reload openNodes tasks
......@@ -115,7 +115,9 @@ toHtml reload tree@(NTree (LNode {id, name, nodeType}) ary) tasks@(asyncTasks /\
)
]
onAsyncTaskFinish (GT.AsyncTaskWithType {task: GT.AsyncTask {id: id'}}) = setAsyncTasks $ const newAsyncTasks
onAsyncTaskFinish (GT.AsyncTaskWithType {task: GT.AsyncTask {id: id'}}) = do
setAsyncTasks $ const newAsyncTasks
setReload (_ + 1)
where
newAsyncTasks = A.filter (\(GT.AsyncTaskWithType {task: GT.AsyncTask {id: id''}}) -> id' /= id'') asyncTasks
......@@ -160,8 +162,10 @@ performAction session (NTree (LNode {id}) _) (_ /\ setReload) _ (_ /\ setAsyncTa
liftEffect $ log2 "[performAction] SearchQuery task:" task
liftEffect $ setReload (_ + 1)
performAction session (NTree (LNode {id}) _) _ _ _ (Submit name) = do
performAction session (NTree (LNode {id}) _) (_ /\ setReload) _ _ (Submit name) = do
void $ renameNode session id $ RenameValue {name}
liftEffect do
setReload (_ + 1)
performAction session (NTree (LNode {id}) _) (_ /\ setReload) (_ /\ setOpenNodes) _ (CreateSubmit name nodeType) = do
void $ createNode session id $ CreateValue {name, nodeType}
......
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