preserving item displaying details on page refresh (#19)

fixes #18
This commit is contained in:
Rok Garbas 2020-05-11 21:33:20 +02:00 committed by GitHub
parent 4efb8ddfec
commit d3c3e2e31b
Failed to generate hash of commit

View file

@ -126,15 +126,16 @@ update path navKey msg model =
)
ShowDetails selected ->
( { model
| showDetailsFor =
if model.showDetailsFor == Just selected then
Nothing
( model
, createUrl path
model.query
(if model.showDetailsFor == Just selected then
Nothing
else
Just selected
}
, Cmd.none
else
Just selected
)
|> Browser.Navigation.pushUrl navKey
)