From 9072029945f4a58840a43c9450abdbe4d166381c Mon Sep 17 00:00:00 2001 From: E44 <129310925+programmer-44@users.noreply.github.com> Date: Sat, 3 Jan 2026 15:01:55 +0100 Subject: [PATCH] fix(control): close popups immediately after submitting -> ui feels faster and second input is not longer possible --- control/frontend/src/routes/+page.svelte | 4 ++-- control/frontend/src/routes/FileView.svelte | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/control/frontend/src/routes/+page.svelte b/control/frontend/src/routes/+page.svelte index 023141c..b9f8f5d 100644 --- a/control/frontend/src/routes/+page.svelte +++ b/control/frontend/src/routes/+page.svelte @@ -51,6 +51,7 @@ } async function finalize_add_edit_display(existing_display_id: string | null) { + popup_close_function(); const ip = text_inputs_valid.ip.value; const mac = text_inputs_valid.mac.value === '' ? null : text_inputs_valid.mac.value; const name = text_inputs_valid.name.value; @@ -60,7 +61,6 @@ const status = await ping_ip(text_inputs_valid.ip.value); await add_display(ip, mac, name, status); } - popup_close_function(); } function popup_close_function() { @@ -127,8 +127,8 @@ active_bg="bg-red-500" className="px-4 flex text-red-400 hover:text-stone-100" click_function={async () => { - await remove_display(display_id); popup_close_function(); + await remove_display(display_id); }}>Löschen diff --git a/control/frontend/src/routes/FileView.svelte b/control/frontend/src/routes/FileView.svelte index 91771da..c6ec49e 100755 --- a/control/frontend/src/routes/FileView.svelte +++ b/control/frontend/src/routes/FileView.svelte @@ -72,16 +72,17 @@ } async function create_new_folder() { + popup_close_function(); await create_folder_on_all_selected_displays( current_name.trim(), $current_file_path, $selected_display_ids ); await update_current_folder_on_selected_displays(); - popup_close_function(); } async function edit_file_name(new_file_name: string) { + popup_close_function(); await run_for_selected_files_on_selected_displays(async (ip: string, file_names: string[]) => { if (file_names.length !== 1) { console.log('EEEERRRRROOOOOOR', file_names); @@ -90,7 +91,6 @@ await rename_file(ip, $current_file_path, file_names[0], new_file_name); }); await update_current_folder_on_selected_displays(); - popup_close_function(); } const show_edit_file_popup = async () => { @@ -229,13 +229,13 @@ active_bg="bg-red-500" className="px-4 flex text-red-400 hover:text-stone-100" click_function={async () => { + popup_close_function(); await run_for_selected_files_on_selected_displays( async (ip: string, file_names: string[]) => { await delete_files(ip, $current_file_path, file_names); } ); await update_current_folder_on_selected_displays(); - popup_close_function(); }}>Löschen