[ngrams] ngramsValidPatch put to appropriate use

For ngrams table, we set ngramsValidPatch = mempty because the table
is refreshed and we have issue
gargantext/purescript-gargantext#594

However, we need to keep that field, it turns out, because we have
gargantext/purescript-gargantext#598

Recently applied patches are needed for the document ngrams
highlighting.

This all would be unnecessary (or at least moved to the backend) if we
had
gargantext/purescript-gargantext#553
parent 77ad2d50
...@@ -35,7 +35,6 @@ import Gargantext.Sessions (Session) ...@@ -35,7 +35,6 @@ import Gargantext.Sessions (Session)
import Gargantext.Utils ((?)) import Gargantext.Utils ((?))
import Gargantext.Utils as U import Gargantext.Utils as U
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Record as Record import Record as Record
...@@ -118,6 +117,7 @@ layoutWithContextNgramsCpt = here.component "layoutWithContextNgrams" cpt where ...@@ -118,6 +117,7 @@ layoutWithContextNgramsCpt = here.component "layoutWithContextNgrams" cpt where
-- here.log2 "[layout] contextNgrams" contextNgrams -- here.log2 "[layout] contextNgrams" contextNgrams
-- here.log2 "[layout] contextNgrams'" contextNgrams' -- here.log2 "[layout] contextNgrams'" contextNgrams'
-- here.log2 "[layout] state'" state' -- here.log2 "[layout] state'" state'
-- here.log2 "[layout] ngrams'" ngrams'
mode' /\ mode <- R2.useBox' AFT.EditionMode mode' /\ mode <- R2.useBox' AFT.EditionMode
......
...@@ -436,8 +436,8 @@ syncPatches props state callback = do ...@@ -436,8 +436,8 @@ syncPatches props state callback = do
s { s {
ngramsLocalPatch = fromNgramsPatches mempty ngramsLocalPatch = fromNgramsPatches mempty
, ngramsStagePatch = fromNgramsPatches mempty , ngramsStagePatch = fromNgramsPatches mempty
, ngramsValidPatch = fromNgramsPatches mempty -- , ngramsValidPatch = fromNgramsPatches mempty
-- , ngramsValidPatch = fromNgramsPatches newPatch <> ngramsLocalPatch <> s.ngramsValidPatch , ngramsValidPatch = fromNgramsPatches newPatch <> ngramsLocalPatch <> s.ngramsValidPatch
-- First the already valid patch, then the local patch, then the newly received newPatch. -- First the already valid patch, then the local patch, then the newly received newPatch.
, ngramsVersion = newVersion , ngramsVersion = newVersion
}) state }) state
...@@ -526,7 +526,7 @@ coreDispatch _ state (CommitPatch pt) = ...@@ -526,7 +526,7 @@ coreDispatch _ state (CommitPatch pt) =
coreDispatch _ state ResetPatches = coreDispatch _ state ResetPatches =
T.modify_ (_ { ngramsLocalPatch = mempty :: NgramsTablePatch T.modify_ (_ { ngramsLocalPatch = mempty :: NgramsTablePatch
, ngramsSelection = mempty :: Set NgramsTerm , ngramsSelection = mempty :: Set NgramsTerm
-- , ngramsValidPatch = mempty :: NgramsTablePatch , ngramsValidPatch = mempty :: NgramsTablePatch
}) state }) state
isSingleNgramsTerm :: NgramsTerm -> Boolean isSingleNgramsTerm :: NgramsTerm -> Boolean
......
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