Refactor sound context and update sound settings functionality; remove console logs and improve sound file handling
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import type { SightingType } from "../../types/types";
|
||||
import { BLANK_IMG, getSoundFileName } from "../../utils/utils";
|
||||
import { BLANK_IMG, getSoundFileURL } from "../../utils/utils";
|
||||
import NumberPlate from "../PlateStack/NumberPlate";
|
||||
import Card from "../UI/Card";
|
||||
import CardHeader from "../UI/CardHeader";
|
||||
@@ -43,8 +43,8 @@ export default function SightingHistoryWidget({
|
||||
const { state } = useSoundContext();
|
||||
|
||||
const soundSrc = useMemo(() => {
|
||||
return getSoundFileName(state.sightingSound) ?? popup;
|
||||
}, [state.sightingSound]);
|
||||
return getSoundFileURL(state.NPEDsound) ?? popup;
|
||||
}, [state.NPEDsound]);
|
||||
|
||||
const { play } = useSound(soundSrc);
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user