Compare the enum value to the input, not the index of the enumeration (#3277)

This commit is contained in:
Shefali Joshi 2020-08-11 13:19:38 -07:00 committed by GitHub
parent c6ca912f2b
commit 270f07ebd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,7 +211,7 @@ export default class TelemetryCriterion extends EventEmitter {
let inputValue; let inputValue;
if (metadataObject) { if (metadataObject) {
if (metadataObject.enumerations && input.length) { if (metadataObject.enumerations && input.length) {
const enumeration = metadataObject.enumerations[input[0]]; const enumeration = metadataObject.enumerations.find((item) => item.value.toString() === input[0].toString());
if (enumeration !== undefined && enumeration.string) { if (enumeration !== undefined && enumeration.string) {
inputValue = [enumeration.string]; inputValue = [enumeration.string];
} }