Play self logon sound after welcome media setup

This commit is contained in:
Jage9
2026-02-28 03:38:44 -05:00
parent 1bb7aca0a4
commit 46fd9fe46f
2 changed files with 7 additions and 3 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.02.28 R312";
window.CHGRID_WEB_VERSION = "2026.02.28 R313";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -1551,7 +1551,6 @@ async function handleAuthResult(message: Extract<IncomingMessage, { type: 'auth_
dom.authPassword.value = '';
dom.registerPassword.value = '';
dom.registerPasswordConfirm.value = '';
void audio.playSample(SYSTEM_SOUND_URLS.logon, 1);
setConnectionStatus('Authenticated. Joining world...');
}
@@ -1871,6 +1870,7 @@ async function onSignalingMessage(message: IncomingMessage): Promise<void> {
}
let restartAnnouncement: string | null = null;
let connectedAnnouncement: string | null = null;
let playSelfLoginSound = false;
if (message.type === 'welcome') {
applyAuthPolicy(message.auth?.policy);
applyAuthPermissions(message.auth?.role, message.auth?.permissions);
@@ -1883,6 +1883,7 @@ async function onSignalingMessage(message: IncomingMessage): Promise<void> {
connectedAnnouncement = reconnectInFlight
? `Reconnected to server. Version ${incomingVersion}.`
: `Connected to server. Version ${incomingVersion}.`;
playSelfLoginSound = !reconnectInFlight;
if (
!reloadScheduledForVersionMismatch &&
APP_VERSION &&
@@ -1905,7 +1906,10 @@ async function onSignalingMessage(message: IncomingMessage): Promise<void> {
}
await onAppMessage(message);
if (message.type === 'welcome') {
void setupMediaAfterAuth();
await setupMediaAfterAuth();
if (playSelfLoginSound) {
void audio.playSample(SYSTEM_SOUND_URLS.logon, 1);
}
}
itemBehaviorRegistry.onUseResultMessage(message);
itemBehaviorRegistry.onWorldUpdate();