Fix initialising pages; improve scroll to item

This commit is contained in:
Eike Kettner 2020-09-25 22:54:50 +02:00
parent 2773eb5341
commit ca05b3c195
2 changed files with 8 additions and 4 deletions

View File

@ -342,9 +342,13 @@ updateManageData lmsg model =
initPage : Model -> Page -> ( Model, Cmd Msg, Sub Msg ) initPage : Model -> Page -> ( Model, Cmd Msg, Sub Msg )
initPage model page = initPage model_ page =
let
model =
{ model_ | page = page }
in
case page of case page of
HomePage mid -> HomePage _ ->
Util.Update.andThen2 Util.Update.andThen2
[ updateHome Page.Home.Data.Init [ updateHome Page.Home.Data.Init
, updateQueue Page.Queue.Data.StopRefresh , updateQueue Page.Queue.Data.StopRefresh

View File

@ -26,7 +26,7 @@ update mId key flags settings msg model =
Init -> Init ->
Util.Update.andThen2 Util.Update.andThen2
[ update mId key flags settings (SearchMenuMsg Comp.SearchMenu.Init) [ update mId key flags settings (SearchMenuMsg Comp.SearchMenu.Init)
, doSearch flags settings , scrollToCard mId
] ]
model model
@ -251,7 +251,7 @@ update mId key flags settings msg model =
ScrollResult _ -> ScrollResult _ ->
let let
cmd = cmd =
Process.sleep 350 |> Task.perform (always ClearItemDetailId) Process.sleep 800 |> Task.perform (always ClearItemDetailId)
in in
withSub ( model, cmd ) withSub ( model, cmd )