diff --git a/ui/desktop/src/components/settings/session/SessionSharingSection.tsx b/ui/desktop/src/components/settings/session/SessionSharingSection.tsx index 3a97dc3e..5f78bc9b 100644 --- a/ui/desktop/src/components/settings/session/SessionSharingSection.tsx +++ b/ui/desktop/src/components/settings/session/SessionSharingSection.tsx @@ -18,7 +18,14 @@ export default function SessionSharingSection() { // Only load saved config from localStorage if the env variable is not provided. useEffect(() => { - if (!envBaseUrlShare) { + if (envBaseUrlShare) { + // If env variable is set, save the forced configuration to localStorage + const forcedConfig = { + enabled: true, + baseUrl: envBaseUrlShare, + }; + localStorage.setItem('session_sharing_config', JSON.stringify(forcedConfig)); + } else { const savedSessionConfig = localStorage.getItem('session_sharing_config'); if (savedSessionConfig) { try { diff --git a/ui/desktop/src/components/settings_v2/sessions/SessionSharingSection.tsx b/ui/desktop/src/components/settings_v2/sessions/SessionSharingSection.tsx index 66942bab..986442bc 100644 --- a/ui/desktop/src/components/settings_v2/sessions/SessionSharingSection.tsx +++ b/ui/desktop/src/components/settings_v2/sessions/SessionSharingSection.tsx @@ -19,7 +19,14 @@ export default function SessionSharingSection() { // Only load saved config from localStorage if the env variable is not provided. useEffect(() => { - if (!envBaseUrlShare) { + if (envBaseUrlShare) { + // If env variable is set, save the forced configuration to localStorage + const forcedConfig = { + enabled: true, + baseUrl: envBaseUrlShare, + }; + localStorage.setItem('session_sharing_config', JSON.stringify(forcedConfig)); + } else { const savedSessionConfig = localStorage.getItem('session_sharing_config'); if (savedSessionConfig) { try {