get navigation messages in order

This commit is contained in:
Brooke Angel 2018-12-07 14:10:34 -08:00 committed by Gavin Panella
parent fa5f4ddbcd
commit 63e47f4cc8

View File

@ -1,7 +1,7 @@
module Update exposing (Msg(..), subscriptions, update)
import Browser exposing (UrlRequest(..))
import Browser.Navigation exposing (pushUrl)
import Browser.Navigation
import Model exposing (..)
import NriModules as NriModules
import Routes
@ -30,14 +30,13 @@ update action model =
OnUrlRequest request ->
case request of
Internal loc ->
( { model | route = Routes.fromLocation loc }, pushUrl model.navigationKey (Url.toString loc) )
( model, Browser.Navigation.pushUrl model.navigationKey (Url.toString loc) )
External loc ->
( model, pushUrl model.navigationKey loc )
( model, Browser.Navigation.load loc )
OnUrlChange route ->
-- TODO
( model, Cmd.none )
( { model | route = Routes.fromLocation route }, Cmd.none )
NoOp ->
( model, Cmd.none )