Skip to content

Commit

Permalink
preserving item displaying details on page refresh
Browse files Browse the repository at this point in the history
fixes #18
  • Loading branch information
garbas committed May 11, 2020
1 parent 4efb8dd commit 8472e74
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/ElasticSearch.elm
Expand Up @@ -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
)


Expand All @@ -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
Expand Down

0 comments on commit 8472e74

Please sign in to comment.