From 56fd1d1760ec91022d00d6cd1a03932ba1e66271 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 11 Mar 2026 12:30:41 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20Launcher=20dead-code=20cleanup=20?= =?UTF-8?q?=E2=80=94=20dead=20else-if=20branch=20and=20unused=20handle=5Fg?= =?UTF-8?q?et=5Fdevice=5Finfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - launcher/+layout.svelte: dead {:else if $events_slct.event_session_id} branch (condition identical to preceding {#if}) replaced with correct {:else if $events_slct.event_location_id} — shows "Select a session" prompt when a room is chosen but no session is yet selected. - launcher/[event_location_id]/+page.svelte: removed unreachable handle_get_device_info() function (never called; pre-relay pattern superseded by launcher_background_sync.svelte's run_device_heartbeat()). Cleaned up now-unused imports. Co-Authored-By: Claude Sonnet 4.6 --- .../(launcher)/launcher/+layout.svelte | 5 +- .../launcher/[event_location_id]/+page.svelte | 145 +----------------- 2 files changed, 10 insertions(+), 140 deletions(-) diff --git a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte index 910d86e5..9b28dcd7 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte @@ -625,12 +625,13 @@ - {:else if $events_slct.event_session_id} + {:else if $events_slct.event_location_id} +
- Loading session details... + Select a session from the menu
{/if} diff --git a/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte b/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte index 50283108..9395f001 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte @@ -10,34 +10,16 @@ // Imports import { untrack } from 'svelte'; import { - ae_snip, ae_loc, ae_sess, ae_api, - ae_trig, - slct, - slct_trigger } from '$lib/stores/ae_stores'; import { events_loc, events_sess, events_slct, - events_trigger, - events_trig } from '$lib/stores/ae_events_stores'; - import { events_func } from '$lib/ae_events_functions'; - import { - kill_processes, - open_local_file_v2, - run_cmd, - run_cmd_sync, - run_osascript, - get_device_info - } from '$lib/electron/electron_relay'; - - // Variables - // Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other. // NOTE: Derived from data.account_id (prop) instead of $slct.account_id (store) // to prevent circular dependency loops during hydration. let ae_acct = $derived(data[data.account_id]); @@ -45,8 +27,6 @@ let url_event_id = $derived(data.params.event_id); let url_event_location_id = $derived(data.params.event_location_id); - // $ae_loc.url_origin = data.url.origin; - $effect(() => { if (log_lvl > 1) { console.log(`event_id: ${url_event_id}`); @@ -61,31 +41,17 @@ $effect(() => { if (ae_acct) { untrack(() => { - $events_slct.event_location_obj_li = ae_acct.slct.event_location_obj_li ?? [ - '' - ]; - $events_slct.id_li__event_location = ae_acct.slct.id_li__event_location ?? [ - '' - ]; - if (log_lvl > 1) { - console.log( - `$events_slct.event_location_obj_li:`, - $events_slct.event_location_obj_li - ); - } - $events_slct.event_session_obj_li = ae_acct.slct.event_session_obj_li ?? [ - '' - ]; + $events_slct.event_location_obj_li = ae_acct.slct.event_location_obj_li ?? ['']; + $events_slct.id_li__event_location = ae_acct.slct.id_li__event_location ?? ['']; + $events_slct.event_session_obj_li = ae_acct.slct.event_session_obj_li ?? ['']; }); } }); - // Set the local storage values + // Set localStorage defaults for launcher state if (!$events_loc.launcher) { $events_loc.launcher = {}; - $events_loc.launcher.slct = { - event_id: null - }; + $events_loc.launcher.slct = { event_id: null }; $events_loc.launcher.show_content__session_code = true; $events_loc.launcher.show_content__presentation_code = true; $events_loc.launcher.show_content__presenter_code = true; @@ -100,108 +66,11 @@ }; } - // Set the session storage values - if (!$events_sess.launcher) { - $events_sess.launcher = {}; - } - + // Set session storage defaults + if (!$events_sess.launcher) $events_sess.launcher = {}; $events_sess.launcher.show_content__session_code = true; $events_sess.launcher.show_content__presentation_code = true; $events_sess.launcher.show_content__presenter_code = true; - - // Variables that will be used with Svelte bind are prefixed with 'bi_'. - - let bi_trig__event_location: any = null; - // let bi_id_li__event_location: string[] = []; - - let bi_trig__event_session: any = null; - // let bi_id_li__event_session: string[] = []; - - // *** Functions and Logic - - // if (browser) { - // console.log(`Browser: ${browser}`); - // } - - // onMount(() => { - // console.log('Pres Mgmt Launcher [slug]: +page@(launcher).svelte'); - // }); - - async function handle_get_device_info(event_device_id: string) { - console.log('*** handle_get_device_info() ***'); - // console.log(event_device_id); - - // console.log('GET DEVICE INFO!!! GET DEVICE INFO!!! GET DEVICE INFO!!!'); - - // Using standardized relay method - let get_device_info_promise = get_device_info(); - get_device_info_promise.then(function (result) { - // console.log('GOT DEVICE INFO!!! GOT DEVICE INFO!!! GOT DEVICE INFO!!!'); - console.log(get_device_info_promise); - let event_device_data: any = {}; - event_device_data['other_json'] = JSON.stringify(result); - - event_device_data['info_hostname'] = result.hostname; - - // console.log(event_device_data['other_json']); - - // console.log(result.networkInterfaces); - - let ni_data_li = []; - let ip_address_li = []; - - for (let network_interface in result.networkInterfaces) { - // console.log(network_interface); - let ni_data: any = {}; - - if (network_interface.startsWith('en')) { - console.log('Wired or wireless network interface found'); - - ni_data['name'] = network_interface; - - let ni_details = - result.networkInterfaces[network_interface]; - // console.log(ni_details); - - for (let i = 0; i < ni_details.length; i++) { - ni_data['address'] = ni_details[i].address; - ni_data['mac'] = ni_details[i].mac; - - ip_address_li.push(ni_details[i].address); - } - - ni_data_li.push(ni_data); - } - } - - event_device_data['meta_json'] = JSON.stringify(ni_data_li); - console.log(event_device_data['meta_json']); - - event_device_data['info_ip_list'] = ip_address_li.join('; '); - console.log(event_device_data['info_ip_list']); - - let event_device_obj_up_promise = events_func - .update_ae_obj__event_device({ - api_cfg: $ae_api, - event_id: url_event_id, - event_device_id: event_device_id, - data_kv: event_device_data, - log_lvl: 0 - }) - .then(function (up_event_device_result) { - // console.log('UPDATED DEVICE INFO!!! UPDATED DEVICE INFO!!! UPDATED DEVICE INFO!!!'); - if (up_event_device_result) { - console.log(up_event_device_result); - } - }) - .catch(function (error: any) { - console.log('No results returned or failed.'); - console.log(error); - }); - }); - - return get_device_info_promise; - }