Commit 637726ef authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[table] fix cache keys to be unique

parent c0b777db
...@@ -218,7 +218,7 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where ...@@ -218,7 +218,7 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where
[ pageLayout { cacheState [ pageLayout { cacheState
, corpusId , corpusId
, frontends , frontends
, key: show $ fst cacheState , key: "docView-" <> (show $ fst cacheState)
, listId , listId
, nodeId , nodeId
, params , params
......
...@@ -98,6 +98,7 @@ annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt ...@@ -98,6 +98,7 @@ annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt
, cacheState , cacheState
, date , date
, desc: name , desc: name
, key: "annuaire-" <> (show $ fst cacheState)
, query: "" , query: ""
, title: name , title: name
, user: "" } , user: "" }
......
module Gargantext.Components.Nodes.Lists where module Gargantext.Components.Nodes.Lists where
import Data.Tuple (fst)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Reactix as R import Reactix as R
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -63,6 +64,7 @@ listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKe ...@@ -63,6 +64,7 @@ listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKe
, cacheState , cacheState
, date , date
, desc , desc
, key: "listsLayoutWithKey-header-" <> (show $ fst cacheState)
, query , query
, title: "Corpus " <> name , title: "Corpus " <> name
, user: authors } , user: authors }
...@@ -70,6 +72,7 @@ listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKe ...@@ -70,6 +72,7 @@ listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKe
cacheState cacheState
, corpusData , corpusData
, corpusId , corpusId
, key: "listsLayoutWithKey-tabs-" <> (show $ fst cacheState)
, session } , session }
] ]
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -33,10 +33,15 @@ type Props = ( cacheState :: R.State NTypes.CacheState ...@@ -33,10 +33,15 @@ type Props = ( cacheState :: R.State NTypes.CacheState
, session :: Session , session :: Session
) )
tabs :: Record Props -> R.Element type PropsWithKey = (
key :: String
| Props
)
tabs :: Record PropsWithKey -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component Props tabsCpt :: R.Component PropsWithKey
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where where
cpt { cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do cpt { cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do
......
...@@ -4,6 +4,7 @@ import Prelude ...@@ -4,6 +4,7 @@ import Prelude
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow) import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Reactix as R import Reactix as R
...@@ -69,6 +70,7 @@ textsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "textsLayoutWithKe ...@@ -69,6 +70,7 @@ textsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "textsLayoutWithKe
, cacheState , cacheState
, date , date
, desc , desc
, key: "textsLayoutWithKey-" <> (show $ fst cacheState)
, query , query
, title , title
, user: authors } , user: authors }
......
...@@ -99,6 +99,7 @@ type TableHeaderLayoutProps = ...@@ -99,6 +99,7 @@ type TableHeaderLayoutProps =
, cacheState :: R.State NT.CacheState , cacheState :: R.State NT.CacheState
, date :: String , date :: String
, desc :: String , desc :: String
, key :: String
, query :: String , query :: String
, title :: String , title :: String
, user :: String , user :: String
......
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