Merge a75d939cb0 into da71eaebd2
This commit is contained in:
commit
206bc46a94
@ -84,6 +84,16 @@ function normalizeSessionKeyForDefaults(
|
|||||||
|
|
||||||
function applySessionDefaults(host: GatewayHost, defaults?: SessionDefaultsSnapshot) {
|
function applySessionDefaults(host: GatewayHost, defaults?: SessionDefaultsSnapshot) {
|
||||||
if (!defaults?.mainSessionKey) return;
|
if (!defaults?.mainSessionKey) return;
|
||||||
|
|
||||||
|
// If session was explicitly set from URL, don't override with defaults
|
||||||
|
// This ensures direct links to specific sessions work correctly
|
||||||
|
const hostWithFlag = host as GatewayHost & { sessionFromUrl?: boolean };
|
||||||
|
if (hostWithFlag.sessionFromUrl) {
|
||||||
|
// Clear the flag after first connection so future reconnects can apply defaults if needed
|
||||||
|
hostWithFlag.sessionFromUrl = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const resolvedSessionKey = normalizeSessionKeyForDefaults(host.sessionKey, defaults);
|
const resolvedSessionKey = normalizeSessionKeyForDefaults(host.sessionKey, defaults);
|
||||||
const resolvedSettingsSessionKey = normalizeSessionKeyForDefaults(
|
const resolvedSettingsSessionKey = normalizeSessionKeyForDefaults(
|
||||||
host.settings.sessionKey,
|
host.settings.sessionKey,
|
||||||
|
|||||||
@ -88,6 +88,8 @@ export function applySettingsFromUrl(host: SettingsHost) {
|
|||||||
const session = sessionRaw.trim();
|
const session = sessionRaw.trim();
|
||||||
if (session) {
|
if (session) {
|
||||||
host.sessionKey = session;
|
host.sessionKey = session;
|
||||||
|
// Mark that this session was explicitly set from URL to prevent override by defaults
|
||||||
|
(host as { sessionFromUrl?: boolean }).sessionFromUrl = true;
|
||||||
applySettings(host, {
|
applySettings(host, {
|
||||||
...host.settings,
|
...host.settings,
|
||||||
sessionKey: session,
|
sessionKey: session,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user