Check if demo messaging process exists, create it if not
This commit is contained in:
parent
36257ebba7
commit
37e69790d9
@ -37,20 +37,23 @@ export async function init() {
|
|||||||
search_div.appendChild(dropdown_icon);
|
search_div.appendChild(dropdown_icon);
|
||||||
|
|
||||||
const processes = await getProcesses();
|
const processes = await getProcesses();
|
||||||
|
let hasMessaging = false;
|
||||||
|
|
||||||
for (const {key, value} of processes) {
|
for (const {key, value} of processes) {
|
||||||
const processName = await getDescription(key, value);
|
const processName = await getDescription(key, value);
|
||||||
if (processName) {
|
if (processName) {
|
||||||
console.log('adding process name to list:', processName);
|
console.log('adding process name to list:', processName);
|
||||||
|
if (processName === "messaging") {
|
||||||
|
hasMessaging = true;
|
||||||
|
}
|
||||||
const opt = new Option(processName);
|
const opt = new Option(processName);
|
||||||
opt.value = processName;
|
opt.value = processName;
|
||||||
opt.setAttribute('data-process-id', key);
|
opt.setAttribute('data-process-id', key);
|
||||||
element.add(opt);
|
element.add(opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { autocomplete_options } = getOptions(element);
|
|
||||||
|
|
||||||
if (autocomplete_options.length === 0) {
|
if (!hasMessaging) {
|
||||||
console.log('No existing processes - creating new messaging process');
|
console.log('No existing processes - creating new messaging process');
|
||||||
await createMessagingProcess();
|
await createMessagingProcess();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user