Browse Source

Fix router url handling for child routers

master
Zak Patterson 5 years ago
parent
commit
fe08dd3915
  1. 2
      outwatch-router/src/main/scala/outwatch/router/Router.scala
  2. 2
      project/Version.scala

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

@ -15,7 +15,7 @@ final case class RouterState[P](page: P)
class AppRouter[F[_]: LiftIO, P](root: Path, f: Path => P) {
def routerReducer(state: RouterState[P], action: Action): RouterState[P] = action match {
case Replace(path) =>
Path.unapplySeq(Path(root, path)).foreach(p => window.history.replaceState("", "", p.mkString("/")))
window.history.replaceState("", "", Path(root, path).toString)
state.copy(page = f(path))
case _ => state
}

2
project/Version.scala

@ -1,4 +1,4 @@
object Version{
val version = "0.0.3"
val version = "0.0.4"
val scalaVersion = "2.12.8"
}
Loading…
Cancel
Save