Delete creating a Messaging Process for a process page init
This commit is contained in:
parent
b6df4dc5e3
commit
f349b5a967
@ -36,44 +36,6 @@ export async function init() {
|
|||||||
search_div.appendChild(autocomplete_list);
|
search_div.appendChild(autocomplete_list);
|
||||||
search_div.appendChild(dropdown_icon);
|
search_div.appendChild(dropdown_icon);
|
||||||
|
|
||||||
const processes = await getProcesses();
|
|
||||||
let hasMessaging = false;
|
|
||||||
|
|
||||||
for (const {key, value} of processes) {
|
|
||||||
const processName = await getDescription(key, value);
|
|
||||||
if (processName) {
|
|
||||||
console.log('adding process name to list:', processName);
|
|
||||||
if (processName === "messaging") {
|
|
||||||
hasMessaging = true;
|
|
||||||
}
|
|
||||||
const opt = new Option(processName);
|
|
||||||
opt.value = processName;
|
|
||||||
opt.setAttribute('data-process-id', key);
|
|
||||||
element.add(opt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasMessaging) {
|
|
||||||
console.log('No existing processes - creating new messaging process');
|
|
||||||
setTimeout(async () => {
|
|
||||||
await createMessagingProcess();
|
|
||||||
}, 0);
|
|
||||||
|
|
||||||
const updatedProcesses = await getProcesses();
|
|
||||||
for (const {key, value} of updatedProcesses) {
|
|
||||||
const processName = await getDescription(key, value);
|
|
||||||
if (processName) {
|
|
||||||
console.log('adding new process to list:', processName);
|
|
||||||
const opt = new Option(processName);
|
|
||||||
opt.value = processName;
|
|
||||||
opt.setAttribute('data-process-id', key);
|
|
||||||
element.add(opt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log('Existing processes found - skipping messaging creation');
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the wrapper as child (instead of the element)
|
// set the wrapper as child (instead of the element)
|
||||||
element.parentNode?.replaceChild(wrapper, element);
|
element.parentNode?.replaceChild(wrapper, element);
|
||||||
// set element as child of wrapper
|
// set element as child of wrapper
|
||||||
|
Loading…
x
Reference in New Issue
Block a user