diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/platform.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js index 78e27eb..b1025c5 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js @@ -263,6 +263,25 @@ export const node = { return bridge.node.service.restart(); }, }, + /** + * Windows only: run the daemon at sign-in. `service.status()` already + * reports the current state as `autostart`; these two just flip it. + * `available` gates nothing platform-specific by itself — main.js answers + * `{ supported: false }` off Windows, same shape as `service`. + */ + autostart: { + available: Boolean(bridge && bridge.node && bridge.node.autostart), + async install() { + if (!bridge || !bridge.node || !bridge.node.autostart) + throw new Error('Node bridge not available'); + return bridge.node.autostart('install'); + }, + async remove() { + if (!bridge || !bridge.node || !bridge.node.autostart) + throw new Error('Node bridge not available'); + return bridge.node.autostart('remove'); + }, + }, }; /** |