aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-11 14:17:55 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-11 17:51:51 +0200
commitd4935aa2a28fcbab8c3556e3532e53667092701e (patch)
tree2898874e80493bb7067401b4462b51edba267e69 /packages/meshbay-hub/src/meshbay_hub/static/platform.js
parentbca6fc3f0884fcdb0455b502ee4495b04945baee (diff)
downloadmeshbay-d4935aa2a28fcbab8c3556e3532e53667092701e.tar.gz
feat: gate the create-group wizard on whether a node is bundled
MeshBay Light has no bundled meshbay-node.exe, so the create-group wizard (which assumes it can start a local node) needs its own signal, not just platform.node.available. main.js exposes it over IPC (node:bundled) by checking the packaged resources directory rather than trusting a build-time constant; preload.js and platform.js carry it through the usual contextBridge/wrapper path. winCanElevateServiceMode() replaces the two prior 'app.isPackaged' checks for whether the app can offer service-mode elevation -- Light is packaged but has no service-mode.ps1 to elevate into, so packaged alone was already the wrong test even before this target existed. create-group-page.js gates the wizard step that starts a node on the new capability instead of hiding the whole feature; node-page.js's comment fix is unrelated cosmetic drift caught in the same pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index e93ffb3..43b8ba8 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -231,6 +231,16 @@ export const node = {
async installed() {
return bridge && bridge.node ? bridge.node.installed() : { installed: false };
},
+ /**
+ * Does THIS build ship its own node (Full) or not (Light)? Distinct from
+ * `installed`, which also counts one merely found on PATH. A browser has
+ * no bridge at all, so it resolves false the same as `available` does --
+ * create-group-page.js already falls back to the node-free form for that
+ * case, and Light should take the same fallback.
+ */
+ async bundled() {
+ return bridge && bridge.node ? bridge.node.bundled() : false;
+ },
async start(opts) {
if (!bridge || !bridge.node) throw new Error('Node bridge not available');
return bridge.node.start(opts);
@@ -288,11 +298,10 @@ export const node = {
},
/**
* Windows only: switch INTO or OUT OF service mode after install — the
- * installer's own choice is effectively one-shot (build/installer.nsh skips
- * it once the firewall rules exist for any reason, and per-user mode sets
- * those up on its own with no Scheduled Task), so this is the only way back
- * in if it was declined, or out if it was chosen and no longer wanted. One
- * elevation, task + firewall together — same script the installer runs.
+ * installer's own radio page (build/installer.nsh) only runs once, at
+ * install time, so this is the only way back in if a different mode was
+ * chosen there and is no longer wanted. One elevation, task + firewall
+ * together — same script the installer runs.
*/
serviceMode: {
available: Boolean(bridge && bridge.node && bridge.node.serviceMode),