excluding disabled prompts. related to #12

This commit is contained in:
mic 2024-05-13 21:53:32 +02:00
parent a3b34b7dbf
commit 5122edadac
2 changed files with 5 additions and 2 deletions

View file

@ -42,7 +42,7 @@ export class mzta_Menus {
async initialize() {
this.allPrompts = await getPrompts();
this.allPrompts = await getPrompts(true);
this.allPrompts.forEach((prompt) => {
this.addAction(prompt)
});

View file

@ -138,10 +138,13 @@ const defaultPrompts = [
];
export async function getPrompts(){
export async function getPrompts(filterDisabled = false){
const defaultPrompts = await getDefaultPrompts_withProps();
const customPrompts = await getCustomPrompts();
let output = defaultPrompts.concat(customPrompts);
if(filterDisabled){
output = output.filter(obj => obj.enabled != 0);
}
output.sort((a, b) => a.id.localeCompare(b.id));
for(let i=1; i<=output.length; i++){
output[i-1].idnum = i;