mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
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:
parent
8e419a772f
commit
c008443f2d
@ -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]) {
|
||||
|
Loading…
Reference in New Issue
Block a user