From 46fd9fe46f3bda347d8b705aa1e9b14a8e8a6c87 Mon Sep 17 00:00:00 2001 From: Jage9 Date: Sat, 28 Feb 2026 03:38:44 -0500 Subject: [PATCH] Play self logon sound after welcome media setup --- client/public/version.js | 2 +- client/src/main.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/public/version.js b/client/public/version.js index eb94ade..be75492 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -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"; diff --git a/client/src/main.ts b/client/src/main.ts index d972d22..27625eb 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -1551,7 +1551,6 @@ async function handleAuthResult(message: Extract { } 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 { 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 { } 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();