From 3df09713d3a57d22b20cefc5734825f91cfb77e9 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 11 Mar 2026 18:54:40 -0400 Subject: [PATCH] fix: poster WS remote control - push open and resolve file obj - launcher_file_cont: poster 'Open Poster' click now sends ae_open:event_file command to remote display when controller=local_push and WS is connected - +layout.svelte handle_ws_recv: ae_open: handler now looks up the file obj from Dexie after setting modal__open_event_file_id, so the remote modal has the hosted_file_id needed to render the poster image (was showing 'No image selected' on remote device) --- .../events/[event_id]/(launcher)/launcher/+layout.svelte | 8 ++++++++ .../[event_id]/(launcher)/launcher_file_cont.svelte | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte index 83ed17be..43a02b0f 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte @@ -340,6 +340,14 @@ restartCountdown(); $events_slct.event_file_id = obj_id; $events_sess.launcher.modal__open_event_file_id = obj_id; + // Look up the file object from Dexie so the modal can render the image. + // The remote device has no event_file_obj in scope — only the ID was sent over WS. + db_events.file.get(obj_id).then((file_obj: any) => { + if (file_obj) { + $events_sess.launcher.modal__event_file_obj = file_obj; + $events_sess.launcher.modal__title = file_obj.filename ?? ''; + } + }); } } else if (cmd.startsWith('ae_close:')) { if (cmd.split(':')[1] == 'event_file_modal') { 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 8a674361..6a8a7312 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte @@ -265,6 +265,11 @@ if (!modal__title) modal__title = event_file_obj.filename; $events_slct.event_file_id = event_file_id; $events_slct.event_file_obj = event_file_obj; + // Push the open command to the remote display when in local_push mode + if ($events_loc.launcher.controller == 'local_push' && $events_sess.launcher.ws_connect_status == 'connected') { + $events_sess.launcher.controller_cmd = `ae_open:event_file=${event_file_id}`; + $events_sess.launcher.controller_trigger_send = true; + } }} > {#snippet label()}