Don't put 'undefined' in the URL

This commit is contained in:
Pieter Vander Vennet 2020-11-02 20:15:55 +01:00
parent f63002b325
commit b8f33f0467

View file

@ -44,9 +44,15 @@ export class QueryParameters {
if (QueryParameters.knownSources[key] === undefined || QueryParameters.knownSources[key].data === undefined) { if (QueryParameters.knownSources[key] === undefined || QueryParameters.knownSources[key].data === undefined) {
continue; continue;
} }
if (QueryParameters.knownSources[key].data === undefined) {
continue;
}
if (QueryParameters.knownSources[key].data == QueryParameters.defaults[key]) { if (QueryParameters.knownSources[key].data == QueryParameters.defaults[key]) {
continue; continue;
} }
parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(QueryParameters.knownSources[key].data)) parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(QueryParameters.knownSources[key].data))
} }
history.replaceState(null, "", "?" + parts.join("&")); history.replaceState(null, "", "?" + parts.join("&"));