[fix](trx-frontend-http): load scheduler eagerly and auto-init on late load

The lazy plugin loader (25c5940) deferred scheduler.js to the 'settings'
tab, but initSettingsUI() runs at app boot before the user clicks any tab.
This meant initScheduler was undefined at boot, so the scheduler-control-row
on the main tab never showed and status polling never started.

Two fixes:
1. Add 'settings' to the eagerly-loaded plugin list so scheduler.js and
   vchan.js load at startup alongside digital-modes and bookmarks.
2. Add auto-init at the end of scheduler.js: if authRole is already set
   when the script executes (late/lazy load), it self-initializes without
   waiting for initSettingsUI(). This makes it resilient to any load order.

https://claude.ai/code/session_01YNwgQGjCdLjVMcatVy3uQi
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2026-04-01 11:44:16 +00:00
committed by Stan Grams
parent 525224010c
commit 661f013a92
2 changed files with 10 additions and 1 deletions
@@ -1449,4 +1449,13 @@
window.destroyScheduler = destroyScheduler;
window.wireSchedulerEvents = wireSchedulerEvents;
window.setSchedulerRig = setSchedulerRig;
// Auto-initialize if the app has already booted (lazy-load case).
// When loaded eagerly, initSettingsUI() in app.js calls initScheduler();
// when loaded lazily (e.g. settings tab click after boot), the app has
// already passed that point, so we must self-initialize here.
if (typeof authRole !== "undefined" && authRole !== null) {
initScheduler(typeof lastActiveRigId !== "undefined" ? lastActiveRigId : null, authRole);
wireSchedulerEvents();
}
})();