Skip to content

Commit

Permalink
fix download workflow policies validation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Frencil committed Feb 12, 2021
1 parent 0c36701 commit 3128710
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/components/DownloadDataContext/DownloadDataContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ var newStateIsValid = function newStateIsValid(key, value) {
});

default:
return newStateIsAllowable(key, value) && validValues.includes(value);
return newStateIsAllowable(key, value) && (!Array.isArray(validValues) || validValues.includes(value));
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ const newStateIsValid = (key, value, validValues = []) => {
&& value.every((id) => idList.includes(id))
);
default:
return newStateIsAllowable(key, value) && validValues.includes(value);
return (
newStateIsAllowable(key, value)
&& (!Array.isArray(validValues) || validValues.includes(value))
);
}
};

Expand Down

0 comments on commit 3128710

Please sign in to comment.