mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-01 16:36:19 +03:00
Don't call onPageChange from UpdateCacheAndUrlNew - it was incorrectly triggering init to be called again when the URL didn't change.
This commit is contained in:
parent
84d518b143
commit
f6ccc1ed83
@ -477,30 +477,12 @@ update config appMsg model =
|
||||
|
||||
updatedPageData : { userModel : userModel, sharedData : sharedData, actionData : Maybe actionData, pageData : pageData }
|
||||
updatedPageData =
|
||||
{ userModel = userModel
|
||||
{ userModel = previousPageData.userModel
|
||||
, sharedData = newSharedData
|
||||
, pageData = newPageData
|
||||
, actionData = newActionData
|
||||
}
|
||||
|
||||
( userModel, userCmd ) =
|
||||
-- TODO call update on new Model for ErrorPage
|
||||
config.update
|
||||
newSharedData
|
||||
newPageData
|
||||
model.key
|
||||
(config.onPageChange
|
||||
{ protocol = model.url.protocol
|
||||
, host = model.url.host
|
||||
, port_ = model.url.port_
|
||||
, path = newUrl |> urlPathToPath
|
||||
, query = newUrl.query
|
||||
, fragment = newUrl.fragment
|
||||
, metadata = config.urlToRoute newUrl
|
||||
}
|
||||
)
|
||||
previousPageData.userModel
|
||||
|
||||
updatedModel : Model userModel pageData actionData sharedData
|
||||
updatedModel =
|
||||
{ model
|
||||
@ -514,8 +496,7 @@ update config appMsg model =
|
||||
| ariaNavigationAnnouncement = mainView config updatedModel |> .title
|
||||
}
|
||||
, Batch
|
||||
[ UserCmd userCmd
|
||||
, ScrollToTop
|
||||
[ ScrollToTop
|
||||
, if fromLinkClick || urlWithoutRedirectResolution.path /= newUrl.path then
|
||||
BrowserPushUrl newUrl.path
|
||||
|
||||
@ -530,8 +511,7 @@ update config appMsg model =
|
||||
| ariaNavigationAnnouncement = mainView config updatedModel |> .title
|
||||
}
|
||||
, Batch
|
||||
[ UserCmd userCmd
|
||||
, ScrollToTop
|
||||
[ ScrollToTop
|
||||
, if fromLinkClick || urlWithoutRedirectResolution.path /= newUrl.path then
|
||||
BrowserPushUrl newUrl.path
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user