fix(control): close popups immediately after submitting -> ui feels faster and second input is not longer possible

This commit is contained in:
E44
2026-01-03 15:01:55 +01:00
parent a7b38d88de
commit 9072029945
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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</Button
>
</div>
+3 -3
View File
@@ -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</Button
>
</div>