FIX: filterQueryParams mutates state that is essentially global

Let's prevent it from doing this by duplicating the input first.
This commit is contained in:
Daniel Waterworth 2019-11-05 11:24:52 +00:00
parent 8e419a772f
commit c008443f2d

View File

@ -4,7 +4,8 @@ import { defaultHomepage } from "discourse/lib/utilities";
// A helper to build a topic route for a filter
function filterQueryParams(params, defaultParams) {
const findOpts = defaultParams || {};
const findOpts = Object.assign({}, defaultParams || {});
if (params) {
Object.keys(queryParams).forEach(function(opt) {
if (params[opt]) {