Merge branch 'staging' into char-find-and-sendas-extended
This commit is contained in:
commit
57bbd349a0
|
@ -3667,11 +3667,17 @@ function setPromptEntryCallback(args, targetState) {
|
||||||
const prompts = promptManager.serviceSettings.prompts;
|
const prompts = promptManager.serviceSettings.prompts;
|
||||||
|
|
||||||
function parseArgs(arg) {
|
function parseArgs(arg) {
|
||||||
|
// Arg is already an array
|
||||||
|
if (Array.isArray(arg)) {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
const list = [];
|
const list = [];
|
||||||
try {
|
try {
|
||||||
|
// Arg is a JSON-stringified array
|
||||||
const parsedArg = JSON.parse(arg);
|
const parsedArg = JSON.parse(arg);
|
||||||
list.push(...Array.isArray(parsedArg) ? parsedArg : [arg]);
|
list.push(...Array.isArray(parsedArg) ? parsedArg : [arg]);
|
||||||
} catch {
|
} catch {
|
||||||
|
// Arg is a string
|
||||||
list.push(arg);
|
list.push(arg);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
Loading…
Reference in New Issue