Skip to content

Commit f485d6b

Browse files
committed
Fix: guard server.updateSettings RPC call behind server config availability
In hosted-static mode, the cached LocalApi has no rpcClient, causing server.* methods to reject. Now that settings routes are accessible in hosted-static mode, the fire-and-forget updateSettings call would produce unhandled promise rejections. Move the RPC call inside the existing currentServerConfig guard so it only fires when a server is connected.
1 parent 008fc1c commit f485d6b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/web/src/hooks/useSettings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ export function useUpdateSettings() {
165165
const currentServerConfig = getServerConfig();
166166
if (currentServerConfig) {
167167
applySettingsUpdated(applyServerSettingsPatch(currentServerConfig.settings, serverPatch));
168+
// Fire-and-forget RPC — push will reconcile on success
169+
void ensureLocalApi().server.updateSettings(serverPatch);
168170
}
169-
// Fire-and-forget RPC — push will reconcile on success
170-
void ensureLocalApi().server.updateSettings(serverPatch);
171171
}
172172

173173
if (Object.keys(clientPatch).length > 0) {

0 commit comments

Comments
 (0)