feat(launcher): improve Events Presentation Launcher stability and data flow
- Standardized ID usage: Migrated multiple components from '_random' variants to standard 'id' properties to align with V3 backend and Dexie patterns. - Electron Integration: Added global 'native_app' declaration and Window interface augmentation in app.d.ts to resolve TypeScript errors. - Type Safety: Enhanced ae_EventSession interface with missing 'event_file_li' and added runtime null checks in session loading logic. - UI/UX: Restored missing launcher components in location-specific pages and fixed LiveQuery filter logic for session lists. - Bug Fixes: Resolved indexing errors in location list and corrected store update patterns in layout.
This commit is contained in:
@@ -106,7 +106,7 @@
|
||||
|
||||
// let temp_obj = Object.create(event_file_obj)
|
||||
|
||||
// $events_loc.launcher.screen_saver_img_kv[temp_obj.event_file_id_random] = Object.create(temp_obj);
|
||||
// $events_loc.launcher.screen_saver_img_kv[temp_obj.event_file_id] = Object.create(temp_obj);
|
||||
|
||||
// $ae_event_launcher = $ae_event_launcher;
|
||||
}
|
||||
@@ -120,7 +120,7 @@
|
||||
|
||||
let temp_obj = Object.create(event_file_obj);
|
||||
|
||||
$events_loc.launcher.screen_saver_img_kv[temp_obj.event_file_id_random] =
|
||||
$events_loc.launcher.screen_saver_img_kv[temp_obj.event_file_id] =
|
||||
Object.create(temp_obj);
|
||||
|
||||
// $ae_event_launcher = $ae_event_launcher;
|
||||
@@ -166,7 +166,7 @@
|
||||
// "app" mode is for Electron and node.js.
|
||||
// "onsite" mode is for Chrome or Firefox and downloading files with modified extensions and other slight changes.
|
||||
|
||||
if ($events_loc.launcher.app_mode == 'native' && native_app) {
|
||||
if ($events_loc.launcher.app_mode == 'native' && window.native_app) {
|
||||
console.log('* ** *** **** BEGIN TESTING **** *** ** *');
|
||||
console.log(
|
||||
'Process: Check local hash file cache, Download hash file to cache, and Open cached hash file after copying to temp directory'
|
||||
@@ -178,7 +178,7 @@
|
||||
|
||||
open_file_status = 'checking_cache';
|
||||
open_file_status_message = 'Checking local cache...';
|
||||
let check_hash_file_cache_result = await native_app.check_hash_file_cache_v2({
|
||||
let check_hash_file_cache_result = await window.native_app.check_hash_file_cache_v2({
|
||||
local_file_cache_path: $events_loc.launcher.local_file_cache_path,
|
||||
hash: event_file_obj.hash_sha256,
|
||||
check_hash: true
|
||||
@@ -192,7 +192,7 @@
|
||||
open_file_status = 'downloading_file';
|
||||
open_file_status_message = 'Downloading file...';
|
||||
let download_hash_file_to_cache_result =
|
||||
await native_app.download_hash_file_to_cache_v2({
|
||||
await window.native_app.download_hash_file_to_cache_v2({
|
||||
api_base_url: $events_loc.launcher.api.base_url,
|
||||
api_base_url_backup: $events_loc.launcher.api.base_url_backup,
|
||||
local_file_cache_path: $events_loc.launcher.local_file_cache_path,
|
||||
@@ -260,7 +260,7 @@
|
||||
}
|
||||
console.log(`Opening ${filename}`);
|
||||
|
||||
let electron_open_hash_file_to_temp_result = await native_app.open_hash_file_to_temp_v2(
|
||||
let electron_open_hash_file_to_temp_result = await window.native_app.open_hash_file_to_temp_v2(
|
||||
{
|
||||
local_file_cache_path: $events_loc.launcher.local_file_cache_path,
|
||||
hash: event_file_obj.hash_sha256,
|
||||
@@ -466,7 +466,7 @@
|
||||
preset-tonal-primary border border-primary-500
|
||||
min-w-96
|
||||
"
|
||||
title={`Open this file in a modal window:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_id}`}
|
||||
title={`Open this file in a modal window:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj.hosted_file_id} Event File ID: ${event_file_id}`}
|
||||
>
|
||||
{#if screen_saver_exts.includes(event_file_obj.extension)}
|
||||
<span class="fas fa-chart-bar m-1" class:hidden={hide_launch_icon}></span>
|
||||
@@ -535,7 +535,7 @@
|
||||
// ae_promises[event_file_id]
|
||||
ae_promises[event_file_id] = api.download_hosted_file({
|
||||
api_cfg: $ae_api,
|
||||
hosted_file_id: event_file_obj.hosted_file_id_random, // +'x'
|
||||
hosted_file_id: event_file_obj.hosted_file_id, // +'x'
|
||||
return_file: true,
|
||||
filename: new_filename,
|
||||
auto_download: true,
|
||||
@@ -549,9 +549,9 @@
|
||||
|
||||
if ($events_loc.launcher.controller == 'local_push') {
|
||||
console.log(
|
||||
`Local Push Controller Command: ae_download:hosted_file=${event_file_obj.hosted_file_id_random}`
|
||||
`Local Push Controller Command: ae_download:hosted_file=${event_file_obj.hosted_file_id}`
|
||||
);
|
||||
$events_sess.launcher.controller_cmd = `ae_download:hosted_file=${event_file_obj.hosted_file_id_random}:${new_filename}:${event_file_obj.extension}`;
|
||||
$events_sess.launcher.controller_cmd = `ae_download:hosted_file=${event_file_obj.hosted_file_id}:${new_filename}:${event_file_obj.extension}`;
|
||||
$events_sess.launcher.controller_trigger_send = true;
|
||||
// tick();
|
||||
}
|
||||
@@ -563,7 +563,7 @@
|
||||
min-w-full w-full max-w-96
|
||||
preset-tonal-primary border border-primary-500
|
||||
"
|
||||
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_id}`}
|
||||
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}...\nHosted ID: ${event_file_obj.hosted_file_id} Event File ID: ${event_file_id}`}
|
||||
>
|
||||
<span class="shrink text-xs border-r border-gray-400 pr-1">
|
||||
{#await ae_promises[event_file_id]}
|
||||
@@ -571,8 +571,8 @@
|
||||
<span class="fas fa-spinner fa-spin mx-0.5"></span>
|
||||
<span class="">
|
||||
Downloading
|
||||
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id_random]}
|
||||
{$ae_sess.api_download_kv[event_file_obj.hosted_file_id_random]
|
||||
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id]}
|
||||
{$ae_sess.api_download_kv[event_file_obj.hosted_file_id]
|
||||
.percent_completed}%
|
||||
{/if}
|
||||
</span>
|
||||
@@ -641,7 +641,7 @@
|
||||
// ae_promises[event_file_id]
|
||||
ae_promises[event_file_id] = api.download_hosted_file({
|
||||
api_cfg: $ae_api,
|
||||
hosted_file_id: event_file_obj.hosted_file_id_random, // +'x'
|
||||
hosted_file_id: event_file_obj.hosted_file_id, // +'x'
|
||||
return_file: true,
|
||||
filename: event_file_obj.filename,
|
||||
auto_download: true,
|
||||
@@ -681,7 +681,7 @@
|
||||
|
||||
events_func.load_ae_obj_id__event_file({
|
||||
api_cfg: $ae_api,
|
||||
event_file_id: event_file_obj?.event_file_id_random,
|
||||
event_file_id: event_file_obj?.event_file_id,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user