Play end of full reset sound effect when changing feedback sound volume

Closes #1916.
This commit is contained in:
Sapphire committed 2026-08-27 16:30:09 -05:00
1 parent 4fb2a0a854
commit 38079be787
2 files changed
+14 -1

No files matched your search

@@ -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,
+1 -1
View File
@@ -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<ResetResponseT, 'pack'>
) {
if (!resetSounds) throw 'sounds not loaded';
const sounds = resetSounds[resetType];