How about this?

This commit is contained in:
Matthew Stratford 2020-11-02 20:19:14 +00:00
parent 126d43aaa5
commit 779ddf2ff7
No known key found for this signature in database
GPG key ID: 9E53C8B3F0B57395

View file

@ -51,17 +51,19 @@ const considerDoingTheNews = (getState: () => RootState) => async () => {
if (state.settings.doTheNews === "always") {
await actuallyDoTheNews();
} else if (state.settings.doTheNews === "while_live") {
if (
state.broadcast.connectionState in ["CONNECTED", "GOING_LIVE", "LIVE"]
) {
const transition = await broadcastApiRequest<{
autoNews: boolean;
selSource: number;
switchAudioAtMin: number;
}>("/nextTransition", "GET", {});
if (transition.autoNews) {
await actuallyDoTheNews();
}
switch (state.broadcast.connectionState) {
case "CONNECTED":
case "GOING_LIVE":
case "LIVE":
const transition = await broadcastApiRequest<{
autoNews: boolean;
selSource: number;
switchAudioAtMin: number;
}>("/nextTransition", "GET", {});
if (transition.autoNews) {
await actuallyDoTheNews();
}
break;
}
}
};