From 814f042f4778d4b416e4d032ebe81da5df125ade Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 4 May 2018 11:15:50 +0200 Subject: [PATCH] add check if filter is default and remove url fragment if filter is default --- src/ts/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ts/index.ts b/src/ts/index.ts index 05c5876..5c31231 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -66,9 +66,13 @@ function checkFilter() { filter = $('#filter') .val() .toString(); - port.postMessage({ json: input, filter: filter }); - filter = encodeURIComponent(filter); - window.location.hash = 'broq-filter=' + filter; + if(filter != '.') { + port.postMessage({ json: input, filter: filter }); + filter = encodeURIComponent(filter); + window.location.hash = 'broq-filter=' + filter; + } else if(window.location.hash.includes('#broq-filter=')) { + history.pushState("", document.title, window.location.pathname + window.location.search); + } } document.addEventListener('DOMContentLoaded', onLoad, false);