From 47070e2f0c8b7ca127803ef4a3bb20b84c35f5f8 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 2 Aug 2016 10:32:26 -0400 Subject: [PATCH] compare path, not route --- api/router.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/router.js b/api/router.js index 78c42375..496b5684 100644 --- a/api/router.js +++ b/api/router.js @@ -7,16 +7,16 @@ var autoredraw = require("../api/autoredraw") module.exports = function($window, renderer, pubsub) { var router = coreRouter($window) var route = function(root, defaultRoute, routes) { - var current = {route: null, component: null} + var current = {path: null, component: null} var replay = router.defineRoutes(routes, function(payload, args, path, route) { if (typeof payload.view !== "function") { if (typeof payload.render !== "function") payload.render = function(vnode) {return vnode} var render = function(component) { - current.route = route, current.component = component + current.path = path, current.component = component renderer.render(root, payload.render(Vnode(component, null, args, undefined, undefined, undefined))) } if (typeof payload.resolve !== "function") payload.resolve = function() {render(current.component)} - if (route !== current.route) payload.resolve(render, args, path, route) + if (path !== current.path) payload.resolve(render, args, path, route) else render(current.component) } else {