Defer world activation until welcome preflight confirmation

This commit is contained in:
Jage9
2026-02-28 20:58:23 -05:00
parent e669bf8a57
commit 429b295a64
8 changed files with 71 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.03.01 R328";
window.CHGRID_WEB_VERSION = "2026.03.01 R329";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -2091,6 +2091,7 @@ async function onSignalingMessage(message: IncomingMessage): Promise<void> {
}
await onAppMessage(message);
if (message.type === 'welcome') {
signaling.send({ type: 'welcome_ready' });
await setupMediaAfterAuth();
if (playSelfLoginSound) {
void audio.playSample(SYSTEM_SOUND_URLS.logon, 1);

View File

@@ -367,6 +367,7 @@ export type OutgoingMessage =
| { type: 'auth_login'; username: string; password: string }
| { type: 'auth_resume'; sessionToken: string }
| { type: 'auth_logout' }
| { type: 'welcome_ready' }
| { type: 'admin_roles_list' }
| { type: 'admin_role_create'; name: string }
| { type: 'admin_role_update_permissions'; role: string; permissions: string[] }