mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:12:46 +08: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
|
// A helper to build a topic route for a filter
|
||||||
function filterQueryParams(params, defaultParams) {
|
function filterQueryParams(params, defaultParams) {
|
||||||
const findOpts = defaultParams || {};
|
const findOpts = Object.assign({}, defaultParams || {});
|
||||||
|
|
||||||
if (params) {
|
if (params) {
|
||||||
Object.keys(queryParams).forEach(function(opt) {
|
Object.keys(queryParams).forEach(function(opt) {
|
||||||
if (params[opt]) {
|
if (params[opt]) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user