excluding disabled prompts. related to #12
This commit is contained in:
parent
a3b34b7dbf
commit
5122edadac
2 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue