From a987ede7c9034273e58be44526a029fabc0f2a7c Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Tue, 15 Dec 2020 20:20:32 +0100 Subject: [PATCH] Avoid server roundtrip when switching pages When changing pages in webui a server request should not happen. This makes the webapp snappy again. Issue: #508 --- modules/webapp/src/main/elm/App/Update.elm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/webapp/src/main/elm/App/Update.elm b/modules/webapp/src/main/elm/App/Update.elm index 604a24fb..bd43e4d7 100644 --- a/modules/webapp/src/main/elm/App/Update.elm +++ b/modules/webapp/src/main/elm/App/Update.elm @@ -178,8 +178,11 @@ updateWithSub msg model = page = Page.fromUrl url |> Maybe.withDefault (defaultPage model.flags) + + ( m, c, s ) = + initPage model page in - ( model, Page.goto page, Sub.none ) + ( { m | page = page }, c, s ) ToggleNavMenu -> ( { model