diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/app.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/app.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js index ba24822..188b389 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js @@ -569,10 +569,38 @@ function HomePage({ groups, notifications, onMarkRead, onPurge, allowPublicGroup // ── First-run welcome (Electron-only, shown once on empty home) ───────────── function SetupWelcome({ onDismiss }) { + // An install-time NSIS page used to be the only place this choice was + // ever offered, and an AppX/MSIX install has no install-time page at all + // (no custom actions, full stop, not just no elevation) -- so a build + // running its own bundled node needs to say so somewhere the user will + // actually see it, not just leave the choice sitting unfound on the Node + // page. Shown only while neither startup mode is configured yet; it + // disappears on its own once one is (or stays hidden forever if the + // platform has no node.service at all, e.g. Light, non-Windows, browser). + const [startupHint, setStartupHint] = useState(false); + useEffect(() => { + let cancelled = false; + (async () => { + try { + if (!platform.node.available || !(await platform.node.bundled())) return; + if (!platform.node.service.available) return; + const status = await platform.node.service.status(); + const configured = status.mode === 'service' || Boolean(status.autostart); + if (!cancelled && status.supported !== false && !configured) setStartupHint(true); + } catch { /* best effort -- the Node page itself is the source of truth */ } + })(); + return () => { cancelled = true; }; + }, []); + return html`<div class="page-content"> <h2>${t('setup.welcome_title')}</h2> <p class="page-message" style="margin-bottom:24px"> ${t('setup.welcome_message')}</p> + ${startupHint && html` + <p class="page-message" style="margin-bottom:24px"> + ${t('setup.node_startup_hint')} + </p> + `} <div style="display:flex;gap:8px;flex-wrap:wrap"> <a class="btn btn-primary" href="#/create-group"> ${t('setup.create_group')}</a> |