fix bug with sets

This commit is contained in:
Daniel
2019-10-28 09:43:23 -04:00
parent cd3a3a7e81
commit dc634a4d74
5 changed files with 15 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -35,7 +35,7 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.10.1
/** @license React v16.11.0
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -44,7 +44,7 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.10.1
/** @license React v16.11.0
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -53,7 +53,7 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/
/** @license React v0.16.1
/** @license React v0.17.0
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -62,7 +62,7 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.9.0
/** @license React v16.11.0
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

View File

@@ -267,20 +267,19 @@ export default function search_api(input) {
// Sets
let setsList = [];
if (!input.sets.proto) {
for (let key in input.sets) {
if (input.sets[key])
setsList.push({'$eq': key.toUpperCase()});
}
if (setsList.length === 0) {
// Only show prototype cards when explicitly selected
let keys = Object.keys(input.sets);
keys.splice(keys.indexOf("proto"));
for (const i in keys) {
if (!input.sets.proto) keys.splice(keys.indexOf("proto"));
for (let i in keys) {
setsList.push({'$eq': keys[i].toUpperCase()});
}
}
else {
for (const key in input.sets) {
if (input.sets[key])
setsList.push({'$eq': key.toUpperCase()});
}
}
if (setsList.length > 0) {
attackResults = attackResults.find({'gsx$set': {'$or': setsList}});
battlegearResults = battlegearResults.find({'gsx$set': {'$or': setsList}});