Skip to content

Commit

Permalink
Merge pull request #600 from remap-keys/feat-587-improve-matching-con…
Browse files Browse the repository at this point in the history
…ditions

Filter the results of keyboard definitions with PRODUCT string
  • Loading branch information
yoichiro authored Sep 8, 2021
2 parents 1b5aff1 + e647627 commit ea9533c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/services/provider/Firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,12 @@ export class FirebaseProvider implements IStorage, IAuth {
.where('status', '==', 'approved')
.get();
let docs = querySnapshotByVidAndPid.docs;
if (docs.length > 1) {
docs = docs.filter((doc) =>
productName.endsWith(doc.data().product_name)
);
}
// Fix #587 https://github.com/remap-keys/remap/issues/587
// Irrespective of the number of the results, filter the results
// with the Product name.
docs = docs.filter((doc) =>
productName.endsWith(doc.data().product_name)
);
if (docs.length === 0) {
console.warn(
`Keyboard definition not found: ${vendorId}:${productId}:${productName}`
Expand Down

0 comments on commit ea9533c

Please sign in to comment.