diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-settings.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/group-settings.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js index 5d0ab07..f8b4aa5 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js @@ -361,7 +361,8 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, enabledApps, onEnabledApps, scanSettings, onScanSettings, entries, nodeDirs, - appSettings, onAppDirectories, onRefreshIndex, + appSettings, nodeSupportsAppOps, + onAppDirectories, onRefreshIndex, onPaired, onLeft }) { const [members, setMembers] = useState([]); const [adminId, setAdminId] = useState(''); @@ -647,7 +648,14 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, if (!transport || !transport.connected) { throw new Error(t('node.root_no_route')); } - await transport.setAppDirectories(appKey, paths, adminSignFn); + // A node too old for the generic op still answers the three per-app + // messages that came before it, so an operator on one keeps the ability + // they had rather than being handed a control that times out. + if (transport.supportsAppOps) { + await transport.setAppDirectories(appKey, paths, adminSignFn); + } else { + await transport.setAppDirectoriesLegacy(appKey, paths, adminSignFn); + } if (onAppDirectories) onAppDirectories(appKey, paths); }, [transportRef, adminSignFn, onAppDirectories]); @@ -845,11 +853,19 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, <p class="settings-hint">${t('settings_node.shared_directories_hint')}</p> ${!connected && nodeDetected && html` <p class="settings-hint">${t('settings_node.roots_offline_hint')}</p>`} + ${/* Read-only against a node that predates the root operations: + writable, removable, eject and plug have no older equivalent + to fall back to, and an unknown message type is dropped + unanswered — a thirty-second wait ending in a timeout, with + nothing on screen to say the node simply cannot do it. */''} + ${connected && !nodeSupportsAppOps && !nodeDetected && html` + <p class="settings-hint">${t('settings_node.roots_node_too_old')}</p>`} <${SharedDirectoriesTable} roots=${effectiveRoots} groupId=${groupId} transport=${transportRef.current} signFn=${adminSignFn} + readOnly=${connected && !nodeSupportsAppOps && !nodeDetected} nodeDetected=${nodeDetected} onRootsChange=${loadNodeInfo} onRefreshIndex=${onRefreshIndex} /> @@ -876,7 +892,9 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, disabled=${appsBusy} onChange=${() => toggleApp(app.key)} /> `}> - ${activeApps.includes(app.key) + ${!nodeSupportsAppOps && app.key === 'chat' + ? html`<p class="settings-hint">${t('settings_node.app_node_too_old')}</p>` + : activeApps.includes(app.key) ? html`<${app.Settings} roots=${effectiveRoots} dirs=${folderOptions} settings=${appSettings} |