From 9cbfd8362dfb34f6d7b87c1c51a3824962f146e9 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 13 Nov 2013 14:26:14 -0500 Subject: [PATCH] FIX: Warnings in Qunit suite --- .../javascripts/discourse/models/topic_list.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/discourse/models/topic_list.js b/app/assets/javascripts/discourse/models/topic_list.js index 6317f1a8c4b..13458955fc6 100644 --- a/app/assets/javascripts/discourse/models/topic_list.js +++ b/app/assets/javascripts/discourse/models/topic_list.js @@ -12,17 +12,17 @@ function finderFor(filter, params) { var url = Discourse.getURL("/") + filter + ".json"; if (params) { - var keys = Object.keys(params); + var keys = Object.keys(params), + encoded = []; - if (keys.length > 0) { - var encoded = []; - keys.forEach(function(p) { - var value = params[p]; - if (typeof value !== 'undefined') { - encoded.push(p + "=" + value); - } - }); + keys.forEach(function(p) { + var value = params[p]; + if (typeof value !== 'undefined') { + encoded.push(p + "=" + value); + } + }); + if (encoded.length > 0) { url += "?" + encoded.join('&'); } }