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