From 188300c45cf0a42ffa4762807a0c101c854da782 Mon Sep 17 00:00:00 2001 From: Santiago Fisela Date: Mon, 30 Mar 2026 20:40:28 -0300 Subject: [PATCH] Null volume hotfix --- src/components/views/SettingsView.tsx | 8 ++++---- src/hooks/useAppConfig.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/views/SettingsView.tsx b/src/components/views/SettingsView.tsx index f6fae96..87a124d 100644 --- a/src/components/views/SettingsView.tsx +++ b/src/components/views/SettingsView.tsx @@ -232,16 +232,16 @@ const SettingsView = memo(function SettingsView() { } else if (currentSubMenu === "audio") { items.push({ id: "music", - label: `Music: ${musicVolume}%`, + label: `Music: ${musicVolume ?? 50}%`, type: "slider", - value: musicVolume, + value: musicVolume ?? 50, onChange: setMusicVolume, }); items.push({ id: "sfx", - label: `SFX: ${sfxVolume}%`, + label: `SFX: ${sfxVolume ?? 100}%`, type: "slider", - value: sfxVolume, + value: sfxVolume ?? 100, onChange: setSfxVolume, }); items.push({ diff --git a/src/hooks/useAppConfig.ts b/src/hooks/useAppConfig.ts index 4edb61a..478d2a8 100644 --- a/src/hooks/useAppConfig.ts +++ b/src/hooks/useAppConfig.ts @@ -37,8 +37,8 @@ export function useAppConfig() { if (config.vfxEnabled !== undefined) setVfxEnabled(config.vfxEnabled); if (config.animationsEnabled !== undefined) setAnimationsEnabled(config.animationsEnabled); if (config.rpcEnabled !== undefined) setRpcEnabled(config.rpcEnabled); - if (config.musicVol !== undefined) setMusicVol(config.musicVol); - if (config.sfxVol !== undefined) setSfxVol(config.sfxVol); + if (config.musicVol !== undefined && config.musicVol !== null) setMusicVol(config.musicVol); + if (config.sfxVol !== undefined && config.sfxVol !== null) setSfxVol(config.sfxVol); if (config.legacyMode !== undefined) setLegacyMode(config.legacyMode); setIsLoaded(true); }); @@ -83,9 +83,9 @@ export function useAppConfig() { setAnimationsEnabled, rpcEnabled, setRpcEnabled, - musicVol, + musicVol: musicVol ?? 50, setMusicVol, - sfxVol, + sfxVol: sfxVol ?? 100, setSfxVol, isDayTime, setIsDayTime,