From 1f4f9c22086be6f3bb20e72a9ee1bedff106d77b Mon Sep 17 00:00:00 2001 From: Pascal Date: Mon, 6 Jan 2025 16:36:47 +0100 Subject: [PATCH] process_loop_fix --- src/pages/process/process.ts | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/pages/process/process.ts b/src/pages/process/process.ts index 188d0a3..20b7f0d 100755 --- a/src/pages/process/process.ts +++ b/src/pages/process/process.ts @@ -36,23 +36,18 @@ export async function init() { search_div.appendChild(autocomplete_list); search_div.appendChild(dropdown_icon); - // This is temporary - // Create a new process with hardcoded members for demonstration purpose - await createMessagingProcess(); - setTimeout(async () => { - const processes = await getProcesses(); - for (const {key, value} of processes) { - const processName = await getDescription(key, value); - // const processName = value['description']; - if (processName) { - console.log('adding process name to list:', processName); - const opt = new Option(processName); - opt.value = processName; - element.add(opt); - } + const processes = await getProcesses(); + for (const {key, value} of processes) { + const processName = await getDescription(key, value); + if (processName) { + console.log('adding process name to list:', processName); + const opt = new Option(processName); + opt.value = processName; + element.add(opt); } - }, 1000) + } + // set the wrapper as child (instead of the element) element.parentNode?.replaceChild(wrapper, element); // set element as child of wrapper @@ -60,15 +55,6 @@ export async function init() { wrapper.appendChild(search_div); addPlaceholder(wrapper); - - // const select = document.querySelector(".select-field"); - // for (const process of processeList) { - // const option = document.createElement("option"); - // option.setAttribute("value", process.name); - // option.innerText = process.name; - - // select.appendChild(option); - // } } function removePlaceholder(wrapper: HTMLElement) {