Skip to content

Commit

Permalink
Fix history loop issue with /search
Browse files Browse the repository at this point in the history
When an error occurs on the route /search, it defaults back to index
page.  But this error will happen with any bare (no params) search, so
you can get into a loop where the back button is constantly re-pushing
the index-page.
This now replaces the history entry on error, which should fix it.
  • Loading branch information
thostetler committed Oct 21, 2020
1 parent e54ec0b commit e50f3df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/apps/discovery/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ define([

execute: function(callback, args) {

console.log(Backbone.history);

if (_.isFunction(callback)) {
callback.apply(this, args);
}
Expand Down Expand Up @@ -126,7 +128,7 @@ define([
);
}
} else {
this.getPubSub().publish(this.getPubSub().NAVIGATE, 'index-page');
this.getPubSub().publish(this.getPubSub().NAVIGATE, 'index-page', { replace: true });
}
},

Expand Down

0 comments on commit e50f3df

Please sign in to comment.