reconnect: account for delayed autofill nickname before auto-connect after version reload
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Maintainer-controlled web client version.
|
// Maintainer-controlled web client version.
|
||||||
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
||||||
window.CHGRID_WEB_VERSION = "2026.02.22 R169";
|
window.CHGRID_WEB_VERSION = "2026.02.22 R170";
|
||||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||||
|
|||||||
@@ -2201,9 +2201,17 @@ updateStatus('Welcome to the Chat Grid. Press the Settings button to configure y
|
|||||||
try {
|
try {
|
||||||
if (sessionStorage.getItem(AUTO_RECONNECT_AFTER_RELOAD_KEY) === '1') {
|
if (sessionStorage.getItem(AUTO_RECONNECT_AFTER_RELOAD_KEY) === '1') {
|
||||||
sessionStorage.removeItem(AUTO_RECONNECT_AFTER_RELOAD_KEY);
|
sessionStorage.removeItem(AUTO_RECONNECT_AFTER_RELOAD_KEY);
|
||||||
if (storedNickname) {
|
window.setTimeout(() => {
|
||||||
|
const effectiveNickname = sanitizeName(dom.preconnectNickname.value || storedNickname);
|
||||||
|
if (effectiveNickname) {
|
||||||
|
dom.preconnectNickname.value = effectiveNickname;
|
||||||
|
state.player.nickname = effectiveNickname;
|
||||||
|
updateConnectAvailability();
|
||||||
void connect();
|
void connect();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
updateConnectAvailability();
|
||||||
|
}, 250);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// Ignore sessionStorage failures.
|
// Ignore sessionStorage failures.
|
||||||
|
|||||||
Reference in New Issue
Block a user