@lifeaitools/clauth 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/serve.js +16 -0
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -2362,6 +2362,22 @@ async function updateBuildStatus() {
|
|
|
2362
2362
|
}
|
|
2363
2363
|
setInterval(updateBuildStatus, 10000);
|
|
2364
2364
|
|
|
2365
|
+
// Detect daemon restart (PID change) and reload so boot() runs fresh.
|
|
2366
|
+
// Without this, an old tab stays in main-view after restart, sees tunnel
|
|
2367
|
+
// as not_started (vault locked), and gets stuck showing "checking tunnel".
|
|
2368
|
+
let _watchedPid = null;
|
|
2369
|
+
setInterval(async () => {
|
|
2370
|
+
try {
|
|
2371
|
+
const p = await fetch(BASE + "/ping").then(r => r.json());
|
|
2372
|
+
if (_watchedPid && p.pid !== _watchedPid) { window.location.reload(); return; }
|
|
2373
|
+
_watchedPid = p.pid;
|
|
2374
|
+
// Also recover if vault became locked on us (e.g. user locked from another tab)
|
|
2375
|
+
if (p.locked && document.getElementById("main-view").style.display !== "none") {
|
|
2376
|
+
window.location.reload();
|
|
2377
|
+
}
|
|
2378
|
+
} catch {}
|
|
2379
|
+
}, 5000);
|
|
2380
|
+
|
|
2365
2381
|
boot();
|
|
2366
2382
|
</script>
|
|
2367
2383
|
</body>
|