@devries-cameron20 / t3code Mirror · read-only / commits / 5a9b56291f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 12:45 UTC

fix(web): warn when shared settings have no target environment (#9207)

Abdul Azeez committed Sep 3, 2026 at 02:54 UTC 5a9b56291f82b9269346053594d8b5dfca736976
1 file changed +14 -7
apps/web/src/hooks/useSettings.ts
+14 -7
@@ -377,24 +377,31 @@ function useUpdateSettingsTarget(environmentId: EnvironmentId | null) {
377
378 if (Object.keys(serverPatch).length > 0) {
379 const { sharedPatch, localPatch } = splitSharedServerPatch(serverPatch);
380 - if (environmentId && Object.keys(localPatch).length > 0) {
381 - void persistServerSettings({
382 - environmentId,
383 - input: { patch: localPatch },
384 - });
385 - } else {
386 - // Dropping the write silently leaves the control looking saved.
380 + // Dropping the write silently leaves the control looking saved.
381 + const warnUnsaved = () =>
382 toastManager.add({
383 type: "warning",
384 title: "Setting not saved",
385 description: PRIMARY_SETTINGS_UNAVAILABLE_MESSAGE,
386 });
387 + if (Object.keys(localPatch).length > 0) {
388 + if (environmentId) {
389 + void persistServerSettings({
390 + environmentId,
391 + input: { patch: localPatch },
392 + });
393 + } else {
394 + warnUnsaved();
395 + }
396 }
397 if (Object.keys(sharedPatch).length > 0) {
398 const targets = new Set(connectedEnvironmentIds);
399 if (environmentId) {
400 targets.add(environmentId);
401 }
402 + if (targets.size === 0) {
403 + warnUnsaved();
404 + }
405 for (const targetId of targets) {
406 void persistServerSettings({
407 environmentId: targetId,