includeSpecial parameter added to getPrompts. see #183
This commit is contained in:
parent
40448b5a2a
commit
4d7cef81f6
1 changed files with 4 additions and 2 deletions
|
|
@ -182,13 +182,15 @@ const defaultPrompts = [
|
|||
];
|
||||
|
||||
|
||||
export async function getPrompts(onlyEnabled = false){
|
||||
export async function getPrompts(onlyEnabled = false, includeSpecial = false){
|
||||
const _defaultPrompts = await getDefaultPrompts_withProps();
|
||||
// console.log('>>>>>>>>>>>> getPrompts _defaultPrompts: ' + JSON.stringify(_defaultPrompts));
|
||||
const customPrompts = await getCustomPrompts();
|
||||
// console.log('>>>>>>>>>>>> getPrompts customPrompts: ' + JSON.stringify(customPrompts));
|
||||
let output = _defaultPrompts.concat(customPrompts);
|
||||
output = output.filter(obj => obj.is_special != 1); // we do not want special prompts
|
||||
if(!includeSpecial){
|
||||
output = output.filter(obj => obj.is_special != 1); // we do not want special prompts
|
||||
}
|
||||
if(onlyEnabled){
|
||||
output = output.filter(obj => obj.enabled != 0);
|
||||
}else{ // order only if we are not filtering, the filtering is for the menus and we are ordering there after i18n
|
||||
|
|
|
|||
Loading…
Reference in a new issue