Don't poll API for selector stuff if on BAPS.

This commit is contained in:
Matthew Stratford 2021-06-13 18:05:58 +01:00
parent 7508756b00
commit bf050fe656

View file

@ -11,6 +11,8 @@ const SILENCE_WARN_SECS = 5;
export function Timelord() { export function Timelord() {
async function getSource() { async function getSource() {
if (process.env.REACT_APP_BAPSICLE_INTERFACE)
return { id: -1, name: "Unknown" };
let studio = await myradioApiRequest("/selector/studioattime", "GET", null); let studio = await myradioApiRequest("/selector/studioattime", "GET", null);
const sourceNames = [ const sourceNames = [
@ -33,6 +35,7 @@ export function Timelord() {
} }
async function getSilence() { async function getSilence() {
if (process.env.REACT_APP_BAPSICLE_INTERFACE) return false;
let silence = await myradioApiRequest("/selector/issilence", "GET", null); let silence = await myradioApiRequest("/selector/issilence", "GET", null);
return silence >= SILENCE_WARN_SECS; return silence >= SILENCE_WARN_SECS;