Skip to content

Commit

Permalink
Merge pull request #435 from webcss/patch-1
Browse files Browse the repository at this point in the history
fix for #428 introduces new misbehaviour
  • Loading branch information
lhorie committed Jan 30, 2015
2 parents 05831d9 + e158b52 commit eb3885e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mithril.js
Expand Up @@ -614,6 +614,7 @@ var m = (function app(window, undefined) {
}
//m.route(route, params)
else if (type.call(arguments[0]) === STRING) {
var oldRoute = currentRoute;
currentRoute = arguments[0];
var args = arguments[1] || {}
var queryIndex = currentRoute.indexOf("?")
Expand All @@ -623,7 +624,7 @@ var m = (function app(window, undefined) {
var currentPath = queryIndex > -1 ? currentRoute.slice(0, queryIndex) : currentRoute
if (querystring) currentRoute = currentPath + (currentPath.indexOf("?") === -1 ? "?" : "&") + querystring;

var shouldReplaceHistoryEntry = (arguments.length === 3 ? arguments[2] : arguments[1]) === true || currentRoute === arguments[0];
var shouldReplaceHistoryEntry = (arguments.length === 3 ? arguments[2] : arguments[1]) === true || oldRoute === arguments[0];

if (window.history.pushState) {
computePostRedrawHook = function() {
Expand Down

0 comments on commit eb3885e

Please sign in to comment.