- added volume setting for sighting hits
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user