Launcher: Resolved session selection hang and improved reactivity pattern.

This commit is contained in:
Scott Idem
2026-02-11 17:18:55 -05:00
parent cda7a5421c
commit 7549749d14
4 changed files with 95 additions and 189 deletions

View File

@@ -3,7 +3,7 @@
* src/routes/events/ae_comp__event_files_upload.svelte
* Specialized component for uploading files and automatically linking them to Event objects.
*/
import { LoaderCircle } from 'lucide-svelte';
import { LoaderCircle, Upload, UploadCloud } from 'lucide-svelte';
import Element_input_files_tbl from '$lib/elements/element_input_files_tbl.svelte';
// Import storage, functions, and libraries
@@ -67,6 +67,13 @@
let ae_promises: key_val = $state({});
let input_element_id = 'ae_comp__event_files_upload__input';
// WHY: Keep task_id in sync with prop if it hasn't been set by an upload cycle yet
$effect(() => {
if (!ae_promises.upload__hosted_file_obj) {
task_id = link_to_id;
}
});
function prevent_default<T extends Event>(fn: (event: T) => void) {
return function (event: T) {
event.preventDefault();
@@ -193,7 +200,7 @@
>
{#await ae_promises.upload__hosted_file_obj}
<div class="text-lg flex flex-row gap-1 items-center justify-center">
<Lucide.LoaderCircle class="animate-spin m-1" />
<LoaderCircle class="animate-spin m-1" />
<span class="">
Uploading
{#if $ae_sess.api_upload_kv[task_id]}
@@ -222,7 +229,7 @@
>
{#if label}{@render label()}{:else}
<div class="flex items-center justify-center gap-2 mb-2 pt-2">
<Lucide.Upload class="text-primary-500" />
<Upload class="text-primary-500" />
<strong class="preset-tonal-primary px-3 py-1 rounded-full"
>Select Files</strong
>