Better handling of idle with WS messages.

This commit is contained in:
Scott Idem
2025-10-16 10:58:11 -04:00
parent c2ccf0c06d
commit 77b250b4f3
2 changed files with 13 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ import { sineIn } from 'svelte/easing';
// *** Import other supporting libraries
import { liveQuery } from "dexie";
import { Drawer, Footer, Modal } from 'flowbite-svelte';
import { listen, idle, onIdle } from 'svelte-idle'
import { listen, idle, onIdle, restartCountdown } from 'svelte-idle'
import {
// Brain,
@@ -425,6 +425,7 @@ function handle_ws_recv(ws_recv_status: any) {
goto(new_url_str, {replaceState: false});
}
// AE Download (event file ID)
// This does not yet work with the native app caching.
} else if (cmd.startsWith('ae_download:')) {
log_lvl = 1;
@@ -471,7 +472,11 @@ function handle_ws_recv(ws_recv_status: any) {
// We are assuming this is for digital posters and needs to be opened in the modal.
$events_sess.launcher.modal__open_event_file_id = null;
clearInterval(idle_timer_interval);
saver_looping = false;
restartCountdown();
$events_slct.event_file_id = obj_id;
$events_sess.launcher.modal__title = $events_sess.launcher.modal__title ?? '*';
@@ -520,6 +525,10 @@ function handle_ws_recv(ws_recv_status: any) {
// $events_sess.launcher.event_file_open.open_status = 'close';
}
clearInterval(idle_timer_interval);
saver_looping = false;
restartCountdown();
// WORKING! AE Refresh (now)
} else if (cmd.startsWith('ae_refresh:')) {
console.log();

View File

@@ -181,7 +181,7 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig } fro
type="number"
min={3000}
bind:value={$events_loc.launcher.idle_timer}
class="input input-sm w-24 text-right"
class="input input-sm w-28 text-right"
>
</label>
@@ -194,7 +194,7 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig } fro
type="number"
min={500}
bind:value={$events_loc.launcher.idle_cycle}
class="input input-sm w-24 text-right"
class="input input-sm w-28 text-right"
>
</label>
@@ -207,7 +207,7 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig } fro
type="number"
min={750}
bind:value={$events_loc.launcher.idle_loop_period}
class="input input-sm w-24 text-right"
class="input input-sm w-28 text-right"
>
</label>