How about this?
This commit is contained in:
parent
126d43aaa5
commit
779ddf2ff7
1 changed files with 13 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue