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

[FIXME] window location

parent 8e0cb957
module Gargantext.Components.Nodes.Home.Public where module Gargantext.Components.Nodes.Home.Public where
import DOM.Simple.Console (log)
import Effect (Effect)
import Effect.Class (liftEffect)
import DOM.Simple.Window (window)
import FFI.Simple.Functions ((...), delay)
import Data.Tuple (fst) import Data.Tuple (fst)
import Data.Argonaut as Argonaut import Data.Argonaut as Argonaut
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
...@@ -51,9 +56,16 @@ type LoadData = () ...@@ -51,9 +56,16 @@ type LoadData = ()
type LoadProps = (reload :: Int) type LoadProps = (reload :: Int)
loadPublicData :: Record LoadProps -> Aff (Array PublicData) loadPublicData :: Record LoadProps -> Aff (Array PublicData)
loadPublicData _l = get Nothing (backendUrl backend "public") --loadPublicData _l = get Nothing (backendUrl backend "public")
where loadPublicData _l = do
backend = head defaultBackends -- let backend = head defaultBackends
let windowLocation = "localhost:8008/"
windowLocation' <- liftEffect (location {})
_ <- liftEffect $ log windowLocation'
get Nothing (windowLocation <> "public")
location :: forall a. a -> Effect String
location _ = window ... "location" $ []
renderPublic :: R.Element renderPublic :: R.Element
renderPublic = R.createElement renderPublicCpt {} [] renderPublic = R.createElement renderPublicCpt {} []
......
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