Refine reboot notices and sounds for in-progress state
This commit is contained in:
@@ -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.27 R296";
|
||||
window.CHGRID_WEB_VERSION = "2026.02.27 R297";
|
||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||
|
||||
@@ -883,7 +883,7 @@ function classifySystemMessageSound(message: string): keyof typeof SYSTEM_SOUND_
|
||||
if (normalized.includes(' is now known as ') || normalized.startsWith('you are now known as ')) {
|
||||
return 'notify';
|
||||
}
|
||||
if (normalized.startsWith('server rebooting in ') || normalized === 'server reboot already scheduled.') {
|
||||
if (normalized.startsWith('server rebooting in ')) {
|
||||
return 'notify';
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -231,6 +231,11 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
|
||||
deps.playSample(deps.ACTION_SOUND_URL, 1);
|
||||
} else if (message.system) {
|
||||
deps.pushChatMessage(message.message);
|
||||
const normalized = message.message.trim().toLowerCase();
|
||||
if (normalized === 'server reboot already in progress.') {
|
||||
deps.audioUiBlip();
|
||||
break;
|
||||
}
|
||||
const sound = deps.classifySystemMessageSound(message.message);
|
||||
if (sound) {
|
||||
deps.playSample(deps.SYSTEM_SOUND_URLS[sound], 1);
|
||||
|
||||
Reference in New Issue
Block a user