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