From 38079be7872d2d57781ef199c7aeec9ff5e5f3cf Mon Sep 17 00:00:00 2001 From: Sapphire Date: Thu, 27 Aug 2026 16:29:09 -0500 Subject: [PATCH] Play end of full reset sound effect when changing feedback sound volume Closes #1916. --- .../components/settings/pages/InterfaceSettings.tsx | 13 +++++++++++++ gui/app/src/sounds/sounds.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gui/app/src/components/settings/pages/InterfaceSettings.tsx b/gui/app/src/components/settings/pages/InterfaceSettings.tsx index f74e5d8f8..e62e7275d 100644 --- a/gui/app/src/components/settings/pages/InterfaceSettings.tsx +++ b/gui/app/src/components/settings/pages/InterfaceSettings.tsx @@ -19,6 +19,8 @@ import { Dropdown } from '@/components/commons/Dropdown'; import { ArrowRightLeftIcon } from '@/components/commons/icon/ArrowIcons'; import { SystemFileInput } from '@/components/commons/SystemFileInput'; import { useElectron } from '@/hooks/electron'; +import { handleResetSounds } from '@/sounds/sounds'; +import { ResetStatus, ResetType } from 'solarxr-protocol'; interface InterfaceSettingsForm { appearance: { @@ -120,6 +122,17 @@ export function InterfaceSettings() { ]; const onSubmit = (values: InterfaceSettingsForm) => { + if ( + config?.feedbackSoundVolume != values.notifications.feedbackSoundVolume + ) { + handleResetSounds(values.notifications.feedbackSoundVolume, { + resetType: ResetType.FULL, + status: ResetStatus.FINISHED, + bodyParts: [], + progress: 0, + duration: 0, + }); + } setConfig({ watchNewDevices: values.notifications.watchNewDevices, feedbackSound: values.notifications.feedbackSound, diff --git a/gui/app/src/sounds/sounds.ts b/gui/app/src/sounds/sounds.ts index 23a6c3519..4f46e51ed 100644 --- a/gui/app/src/sounds/sounds.ts +++ b/gui/app/src/sounds/sounds.ts @@ -112,7 +112,7 @@ export function restartAndPlay(audio: HTMLAudioElement | null, volume: number) { export function handleResetSounds( volume: number, - { progress, status, resetType }: ResetResponseT + { progress, status, resetType }: Omit ) { if (!resetSounds) throw 'sounds not loaded'; const sounds = resetSounds[resetType];