Fix router url handling for child routers
This commit is contained in:
parent
56e28d8c1d
commit
fe08dd3915
@ -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
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
object Version{
|
||||
val version = "0.0.3"
|
||||
val version = "0.0.4"
|
||||
val scalaVersion = "2.12.8"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user