mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 20:55:30 +02:00
* ACS checks in 'next' blocks can now have a default "catch all" by simply omitting the 'acs' portion of a condition
This commit is contained in:
parent
688e46bc47
commit
48c12ddffb
3 changed files with 31 additions and 10 deletions
|
@ -15,8 +15,18 @@ function getConditionalValue(client, condArray, memberName) {
|
|||
assert(_.isString(memberName));
|
||||
|
||||
var matchCond = _.find(condArray, function cmp(cond) {
|
||||
return acsParser.parse(cond.acs, { client : client } );
|
||||
return _.has(cond, 'acs') && acsParser.parse(cond.acs, { client : client } );
|
||||
});
|
||||
|
||||
//
|
||||
// If no matchCond, look for a default entry. That is,
|
||||
// a entry without a 'acs' string.
|
||||
//
|
||||
if(!matchCond) {
|
||||
matchCond = _.find(condArray, function cmp(cond) {
|
||||
return !_.has(cond, 'acs');
|
||||
});
|
||||
}
|
||||
|
||||
if(matchCond) {
|
||||
return matchCond[memberName];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue