Explorar o código

[search] Do not add dynamic fields more than once

Romain Rigaux %!s(int64=11) %!d(string=hai) anos
pai
achega
5a611dc
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      apps/search/static/js/search.ko.js

+ 3 - 1
apps/search/static/js/search.ko.js

@@ -233,7 +233,9 @@ var Collection = function (vm, collection) {
     },function (data) {
       if (data.status == 0) {
         $.each(data.dynamic_fields, function (index, field) {
-          self.fields.push(field);
+          if (self.fields.indexOf(field) == -1) {
+            self.fields.push(field);
+          }
         });
       }
     }).fail(function (xhr, textStatus, errorThrown) {