From 0861ca7764d37f5b5a2472a54306cc71b58a961e Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Tue, 19 Mar 2019 19:22:06 +0530 Subject: [PATCH] FIX: Don't push browser state if navigated from root url to home page url and vice versa --- .../javascripts/discourse/lib/discourse-location.js.es6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 index 576b135de89..f2585af0576 100644 --- a/app/assets/javascripts/discourse/lib/discourse-location.js.es6 +++ b/app/assets/javascripts/discourse/lib/discourse-location.js.es6 @@ -1,3 +1,5 @@ +import { defaultHomepage } from "discourse/lib/utilities"; + /** @module Discourse */ @@ -87,7 +89,10 @@ const DiscourseLocation = Ember.Object.extend({ path = this.formatURL(path); if (state && state.path !== path) { - this.pushState(path); + const paths = [path, state.path]; + if (!(paths.includes("/") && paths.includes(`/${defaultHomepage()}`))) { + this.pushState(path); + } } },