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,9 +51,10 @@ const considerDoingTheNews = (getState: () => RootState) => async () => {
if (state.settings.doTheNews === "always") { if (state.settings.doTheNews === "always") {
await actuallyDoTheNews(); await actuallyDoTheNews();
} else if (state.settings.doTheNews === "while_live") { } else if (state.settings.doTheNews === "while_live") {
if ( switch (state.broadcast.connectionState) {
state.broadcast.connectionState in ["CONNECTED", "GOING_LIVE", "LIVE"] case "CONNECTED":
) { case "GOING_LIVE":
case "LIVE":
const transition = await broadcastApiRequest<{ const transition = await broadcastApiRequest<{
autoNews: boolean; autoNews: boolean;
selSource: number; selSource: number;
@ -62,6 +63,7 @@ const considerDoingTheNews = (getState: () => RootState) => async () => {
if (transition.autoNews) { if (transition.autoNews) {
await actuallyDoTheNews(); await actuallyDoTheNews();
} }
break;
} }
} }
}; };