Fix long tag query-URL when changing between [Trending|New|Top]

## Issue
4393: Tag query URL goes on indefinitely as you change between [Trending|New|Top]

## Change
Change from `append` to `set` when building the query to remove duplicates.

Flow hates null being not a string, so the FixMe was retained.
This commit is contained in:
infiinte-persistence 2020-10-27 14:39:31 +08:00 committed by Sean Yesmunt
parent ad20e355cf
commit 93b1de8ed9

View file

@ -140,8 +140,8 @@ function ClaimListHeader(props: Props) {
function buildUrl(delta) {
const newUrlParams = new URLSearchParams(location.search);
CS.KEYS.forEach(k => {
// $FlowFixMe append() can't take null as second arg, but get() can return null
if (urlParams.get(k) !== null) newUrlParams.append(k, urlParams.get(k));
// $FlowFixMe get() can return null
if (urlParams.get(k) !== null) newUrlParams.set(k, urlParams.get(k));
});
switch (delta.key) {