Refactor getActiveSpecialPromptsIDs function to accept a single argument object for improved readability and maintainability
This commit is contained in:
parent
cfa65c4934
commit
c449f68cc1
1 changed files with 7 additions and 6 deletions
|
|
@ -345,19 +345,20 @@ export async function transformTagsLabels(labels, tags_list) {
|
|||
return output;
|
||||
}
|
||||
|
||||
export function getActiveSpecialPromptsIDs(addtags = false, get_calendar_event = false, get_task = false, is_chatgpt_web = false) {
|
||||
export function getActiveSpecialPromptsIDs(args = {}) {
|
||||
const { addtags = false, get_calendar_event = false, get_task = false, is_chatgpt_web = false } = args;
|
||||
let output = [];
|
||||
// console.log(">>>>>>>>>> getActiveSpecialPromptsIDs addtags: " + addtags + " get_calendar_event: " + get_calendar_event + " is_chatgpt_web: " + is_chatgpt_web);
|
||||
if(is_chatgpt_web){
|
||||
// console.log(">>>>>>>>>> getActiveSpecialPromptsIDs args: " + JSON.stringify(args));
|
||||
if (is_chatgpt_web) {
|
||||
return output;
|
||||
}
|
||||
if(addtags){
|
||||
if (addtags) {
|
||||
output.push('prompt_add_tags');
|
||||
}
|
||||
if(get_calendar_event){
|
||||
if (get_calendar_event) {
|
||||
output.push('prompt_get_calendar_event');
|
||||
}
|
||||
if(get_task){
|
||||
if (get_task) {
|
||||
output.push('prompt_get_task');
|
||||
}
|
||||
// console.log(">>>>>>>>>> getActiveSpecialPromptsIDs output: " + JSON.stringify(output));
|
||||
|
|
|
|||
Loading…
Reference in a new issue