change - show proto only when selected

This commit is contained in:
Daniel 2019-10-25 10:06:41 -04:00
parent c06f80d68c
commit 797e55cea1
2 changed files with 14 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -267,9 +267,19 @@ export default function search_api(input) {
// Sets
let setsList = [];
for (const key in input.sets) {
if (input.sets[key])
setsList.push({'$eq': key.toUpperCase()});
if (!input.sets.proto) {
// Only show prototype cards when explicitly selected
let keys = Object.keys(input.sets);
keys.splice(keys.indexOf("proto"));
for (const 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}});