- added framework for playing uploaded music files. need to permanently store and retreive files

This commit is contained in:
2025-10-21 12:52:14 +01:00
parent 1ffad51503
commit 78905b09e0
7 changed files with 52 additions and 12 deletions

View File

@@ -21,7 +21,11 @@ const SoundContextProvider = ({ children }: SoundContextProviderProps) => {
path: "soundSettings",
});
dispatch({ type: "UPDATE", payload: result.result });
if (!result.result || typeof result.result !== "object") {
dispatch({ type: "UPDATE", payload: state });
} else {
dispatch({ type: "UPDATE", payload: result.result });
}
};
fetchSound();
// eslint-disable-next-line react-hooks/exhaustive-deps

View File

@@ -34,6 +34,7 @@ export function reducer(state: SoundState, action: SoundAction): SoundState {
NPEDsoundVolume: action.payload.NPEDsoundVolume,
sightingVolume: action.payload.sightingVolume,
hotlistSoundVolume: action.payload.hotlistSoundVolume,
soundOptions: action.payload.soundOptions,
};
}