Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #428 introduces new misbehaviour #435

Merged
merged 1 commit into from Jan 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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