Fix silence detection threshold.

This commit is contained in:
Matthew Stratford 2021-02-06 20:06:30 +00:00
parent 7a7a401114
commit 4bcabb6fb0

View file

@ -6,6 +6,8 @@ import { useInterval } from "../lib/utils";
import { RootState } from "../rootReducer"; import { RootState } from "../rootReducer";
import "./timelord.scss"; import "./timelord.scss";
const SILENCE_WARN_SECS = 5;
export function Timelord() { export function Timelord() {
async function getSource() { async function getSource() {
let studio = await myradioApiRequest("/selector/studioattime", "GET", null); let studio = await myradioApiRequest("/selector/studioattime", "GET", null);
@ -32,7 +34,7 @@ export function Timelord() {
async function getSilence() { async function getSilence() {
let silence = await myradioApiRequest("/selector/issilence", "GET", null); let silence = await myradioApiRequest("/selector/issilence", "GET", null);
return silence; return silence >= SILENCE_WARN_SECS;
} }
const broadcastStage = useSelector( const broadcastStage = useSelector(