From 4d7cef81f6a8389f744facac2e89a9005cd71cd0 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 10 Dec 2024 22:04:03 +0100 Subject: [PATCH] includeSpecial parameter added to getPrompts. see #183 --- js/mzta-prompts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/mzta-prompts.js b/js/mzta-prompts.js index a87d294b..8239c779 100644 --- a/js/mzta-prompts.js +++ b/js/mzta-prompts.js @@ -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