better handling of default prompt in case of future new prompts added. see #12
This commit is contained in:
parent
2c34062235
commit
e2c99e5b3e
1 changed files with 11 additions and 3 deletions
|
|
@ -165,10 +165,18 @@ async function getDefaultPrompts_withProps() {
|
||||||
pos++;
|
pos++;
|
||||||
})
|
})
|
||||||
} else { // we have saved default prompts properties
|
} else { // we have saved default prompts properties
|
||||||
|
let pos = 1000;
|
||||||
defaultPrompts_prop.forEach((prompt) => {
|
defaultPrompts_prop.forEach((prompt) => {
|
||||||
prompt.position_compose = prefs._default_prompts_properties[prompt.id].position_compose;
|
if(prefs._default_prompts_properties?.[prompt.id]){
|
||||||
prompt.position_display = prefs._default_prompts_properties[prompt.id].position_display;
|
prompt.position_compose = prefs._default_prompts_properties[prompt.id].position_compose;
|
||||||
prompt.enabled = prefs._default_prompts_properties[prompt.id].enabled;
|
prompt.position_display = prefs._default_prompts_properties[prompt.id].position_display;
|
||||||
|
prompt.enabled = prefs._default_prompts_properties[prompt.id].enabled;
|
||||||
|
}else{
|
||||||
|
prompt.position_display = pos;
|
||||||
|
prompt.position_compose = pos;
|
||||||
|
prompt.enabled = 1;
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return defaultPrompts_prop;
|
return defaultPrompts_prop;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue