Skip to content
Permalink
Browse files

preserving item displaying details on page refresh

fixes #18
  • Loading branch information
garbas committed May 11, 2020
1 parent 4efb8dd commit 8472e745ba00f0d023f5d2693e35a73a104d4846
Showing with 17 additions and 9 deletions.
  1. +17 −9 src/ElasticSearch.elm
@@ -126,15 +126,16 @@ update path navKey msg model =
)

ShowDetails selected ->
( { model
| showDetailsFor =
if model.showDetailsFor == Just selected then
Nothing

else
Just selected
}
, Cmd.none
( model
, createUrl path
model.query
(if model.showDetailsFor == Just selected then
Nothing

else
Just selected
)
|> Browser.Navigation.pushUrl navKey
)


@@ -154,6 +155,13 @@ showLoadingOnQuery model =

createUrl : String -> Maybe String -> Maybe String -> String
createUrl path query showDetailsFor =
let
_ =
Debug.log "createUrl:query" query

_ =
Debug.log "createUrl:showDetailsFor" showDetailsFor
in
[]
|> List.append
(query

0 comments on commit 8472e74

Please sign in to comment.
You can’t perform that action at this time.