- added volume setting for sighting hits

This commit is contained in:
2025-10-17 16:12:02 +01:00
parent 3eb539fd9d
commit 82b84dc46e
14 changed files with 145 additions and 59 deletions

View File

@@ -1,11 +1,4 @@
import {
useEffect,
useMemo,
useReducer,
useRef,
useState,
type ReactNode,
} from "react";
import { useEffect, useMemo, useReducer, useRef, useState, type ReactNode } from "react";
import { SoundContext } from "../SoundContext";
import { initialState, reducer } from "../reducers/SoundContextReducer";
import { useCameraBlackboard } from "../../hooks/useCameraBlackboard";
@@ -27,7 +20,6 @@ const SoundContextProvider = ({ children }: SoundContextProviderProps) => {
operation: "VIEW",
path: "soundSettings",
});
dispatch({ type: "UPDATE", payload: result.result });
};
fetchSound();
@@ -63,13 +55,8 @@ const SoundContextProvider = ({ children }: SoundContextProviderProps) => {
};
}, []);
const value = useMemo(
() => ({ state, dispatch, audioArmed }),
[state, audioArmed]
);
return (
<SoundContext.Provider value={value}>{children}</SoundContext.Provider>
);
const value = useMemo(() => ({ state, dispatch, audioArmed }), [state, audioArmed]);
return <SoundContext.Provider value={value}>{children}</SoundContext.Provider>;
};
export default SoundContextProvider;