From 8dd22912c36cb7230a8242a9f7c44ab4d966c9ad Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 12 May 2026 13:49:55 -0400 Subject: [PATCH] fix(launcher): keep native open state off download spinner\n\nAdd an opt-out on the shared hosted-file button so promise-returning native opens\ncan use Launcher status text without being treated like active downloads. Apply it\nto the Electron launcher open path so cache hits no longer show 'Downloading...'\nwhen the row status already reports the correct cache/open state. --- .../ae_core/ae_comp__hosted_files_download_button.svelte | 7 +++++-- .../events/[event_id]/(launcher)/launcher_file_cont.svelte | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte b/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte index 0a67ddb9..6e3537d2 100644 --- a/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte +++ b/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte @@ -35,6 +35,7 @@ interface Props { require_auth?: boolean; classes?: string; click?: () => void | Promise; + track_click_promise?: boolean; label?: import('svelte').Snippet; } @@ -57,6 +58,7 @@ let { require_auth = true, classes = '', click, + track_click_promise = true, label }: Props = $props(); @@ -193,8 +195,9 @@ async function handle_click() { if (click) { const result = click(); - // If the override returns a promise, track it so the UI shows progress - if (result instanceof Promise) { + // If the override returns a promise, track it so the UI shows progress. + // Launcher open flows can opt out so native status messages stay authoritative. + if (track_click_promise && result instanceof Promise) { ae_promises[file_id] = result; } return; diff --git a/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte b/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte index ebd5451a..aef975c2 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte @@ -593,6 +593,7 @@ function prevent_default(fn: (event: T) => void) { hosted_file_id={event_file_id} hosted_file_obj={event_file_obj} require_auth={false} + track_click_promise={!($ae_loc.is_native && $events_loc.launcher.app_mode === 'native')} classes="btn {btn_size} gap-1 justify-between min-w-full w-full max-w-96 preset-tonal-primary border border-primary-500" click={handle_open_file}> {#snippet label()}