mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-28 05:26:10 +02:00
Initial support for random 'next', 'action', ...
This commit is contained in:
parent
1e08810188
commit
16f4d62548
2 changed files with 37 additions and 4 deletions
|
@ -7,6 +7,9 @@ const {
|
|||
Errors,
|
||||
ErrorReasons
|
||||
} = require('./enig_error.js');
|
||||
const {
|
||||
getResolvedSpec
|
||||
} = require('./menu_util.js');
|
||||
|
||||
// deps
|
||||
const _ = require('lodash');
|
||||
|
@ -53,7 +56,7 @@ module.exports = class MenuStack {
|
|||
next(cb) {
|
||||
const currentModuleInfo = this.top();
|
||||
const menuConfig = currentModuleInfo.instance.menuConfig;
|
||||
const nextMenu = this.client.acs.getConditionalValue(menuConfig.next, 'next');
|
||||
const nextMenu = getResolvedSpec(this.client, menuConfig.next, 'next');
|
||||
if(!nextMenu) {
|
||||
return cb(Array.isArray(menuConfig.next) ?
|
||||
Errors.MenuStack('No matching condition for "next"', ErrorReasons.NoConditionMatch) :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue