diff --git a/mithril.js b/mithril.js index b8134187..bf4d6b8e 100644 --- a/mithril.js +++ b/mithril.js @@ -1113,9 +1113,9 @@ m.route = function($window, renderer, pubsub) { }(window, renderService, redrawService) m.mount = function(renderer, pubsub) { return function(root, component) { - pubsub.unsubscribe(root.redraw) if (component === null) { renderer.render(root, []) + pubsub.unsubscribe(root.redraw) delete root.redraw return } diff --git a/mithril.min.js b/mithril.min.js index 2512c6bc..cfc9f7d8 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -37,5 +37,5 @@ case "?":return d("search").slice(t.length)+d("hash");default:return d("pathname setImmediate:setTimeout,t="#!";return{setPrefix:function(b){t=b},getPath:g,setPath:k,defineRoutes:function(d,k,f){function y(){var b=g(),l={},n=p(b,l,l);m(function(){for(var g in d){var m=new RegExp("^"+g.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(m.test(n)){n.replace(m,function(){for(var f=g.match(/:[^\/]+/g)||[],m=[].slice.call(arguments,1,-2),n=0;n