From b8f33f0467d6875f716f704921e6e9902227b1ce Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 2 Nov 2020 20:15:55 +0100 Subject: [PATCH] Don't put 'undefined' in the URL --- Logic/Web/QueryParameters.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Logic/Web/QueryParameters.ts b/Logic/Web/QueryParameters.ts index 0651d136b..21a57cc1c 100644 --- a/Logic/Web/QueryParameters.ts +++ b/Logic/Web/QueryParameters.ts @@ -44,9 +44,15 @@ export class QueryParameters { if (QueryParameters.knownSources[key] === undefined || QueryParameters.knownSources[key].data === undefined) { continue; } + + if (QueryParameters.knownSources[key].data === undefined) { + continue; + } + if (QueryParameters.knownSources[key].data == QueryParameters.defaults[key]) { continue; } + parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(QueryParameters.knownSources[key].data)) } history.replaceState(null, "", "?" + parts.join("&"));