[ngrams] half-fix of the ngrams click issue

Thing is, we fixed this on the backend so now we can just click on
parent and the children will be updated on the backend as well.

It's a half-fix because I get errors about inconsistent state: old !=
new when clicking multiple times on the same term.
parent 7ab95e7e
...@@ -342,7 +342,12 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt ...@@ -342,7 +342,12 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
ngramsChildren n = tbl ^.. ix n <<< _NgramsRepoElement <<< _children <<< folded ngramsChildren n = tbl ^.. ix n <<< _NgramsRepoElement <<< _children <<< folded
ngramsClick :: { depth :: Int, ngrams :: NgramsTerm } -> Maybe (Effect Unit) ngramsClick :: { depth :: Int, ngrams :: NgramsTerm } -> Maybe (Effect Unit)
ngramsClick p = Just $ do ngramsClick p = Just $ do
traverse_ (dispatch <<< CoreAction <<< cycleTermListItem) (A.cons p.ngrams $ getNgramsChildren' p.ngrams) -- here.log2 "[ngramsClick] p" p
if p.depth == 0 then
(dispatch <<< CoreAction <<< cycleTermListItem <<< view _ngrams) p
-- traverse_ (dispatch <<< CoreAction <<< cycleTermListItem) (A.cons p.ngrams $ getNgramsChildren' p.ngrams)
else
pure unit
-- ^ This is the old behavior it is nicer to use since one can -- ^ This is the old behavior it is nicer to use since one can
-- rapidly change the ngram list without waiting for confirmation. -- rapidly change the ngram list without waiting for confirmation.
-- However this might expose bugs. One of them can be reproduced -- However this might expose bugs. One of them can be reproduced
......
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