Browse Source

Use correct string method for pushing url state (#8)

master
Zak Patterson 5 years ago
committed by GitHub
parent
commit
60aa576731
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      outwatch-router/src/main/scala/outwatch/router/Router.scala

2
outwatch-router/src/main/scala/outwatch/router/Router.scala

@ -24,7 +24,7 @@ class AppRouter[P](siteRoot: Path, parent: Path, f: Path => P) {
// Sync from the required page to the window.location // Sync from the required page to the window.location
def routerReducer(state: RouterState[P], action: Action): RouterState[P] = action match { def routerReducer(state: RouterState[P], action: Action): RouterState[P] = action match {
case Replace(path) => case Replace(path) =>
window.history.pushState("", "", Path(siteRoot, Path(parent, path)).toString)
window.history.pushState("", "", Path(siteRoot, Path(parent, path)).toUrlString)
state.copy(page = f(path)) state.copy(page = f(path))
case _ => state case _ => state
} }

Loading…
Cancel
Save