From 37e69790d999465216e7a8ecfe3076acd14ca014 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Mon, 13 Jan 2025 11:24:35 +0100 Subject: [PATCH] Check if demo messaging process exists, create it if not --- src/pages/process/process.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/process/process.ts b/src/pages/process/process.ts index a051269..5dca5ce 100755 --- a/src/pages/process/process.ts +++ b/src/pages/process/process.ts @@ -37,20 +37,23 @@ export async function init() { 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); } } - const { autocomplete_options } = getOptions(element); - if (autocomplete_options.length === 0) { + if (!hasMessaging) { console.log('No existing processes - creating new messaging process'); await createMessagingProcess();