FIX: ensures routing with hash doesn't stuck history (#7872)

* FIX: ensures routin with hash doesnt stuck history

Original issue: https://meta.discourse.org/t/hash-anchor-in-url-prevents-further-url-updates/122068/4

Basically when the path has a hash, state would be null, and nothing would happen.

* Update app/assets/javascripts/discourse/lib/discourse-location.js.es6

Co-Authored-By: Régis Hanol <regis@hanol.fr>
This commit is contained in:
Joffrey JAFFEUX 2019-07-10 20:43:03 +02:00 committed by GitHub
parent f89bd55576
commit 142344e45d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ const DiscourseLocation = Ember.Object.extend({
const state = this.getState();
path = this.formatURL(path);
if (state && state.path !== path) {
if (!state || state.path !== path) {
this.replaceState(path);
}
},