From c77e1a28f7937ead8d8e6dd6cd94c603e3e6876a Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 23 Apr 2017 15:31:03 +0300 Subject: [PATCH] fix: ReDoc removes path if site is using history API closes #257 --- lib/services/hash.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/hash.service.ts b/lib/services/hash.service.ts index 82d1ed61ba..fda833e79a 100644 --- a/lib/services/hash.service.ts +++ b/lib/services/hash.service.ts @@ -30,7 +30,7 @@ export class Hash { update(hash: string|null, rewriteHistory:boolean = false) { if (hash == undefined) return; if (rewriteHistory) { - window.history.replaceState(null, '', '#' + hash); + window.history.replaceState(null, '', window.location.href.split("#")[0] + '#' + hash); return; } this.noEmit = true;