the_news: check if we're connected prior to asking for nextTransition
This commit is contained in:
parent
b11de69b0a
commit
ebfde59120
1 changed files with 9 additions and 7 deletions
|
@ -51,13 +51,15 @@ const considerDoingTheNews = (getState: () => RootState) => async () => {
|
|||
if (state.settings.doTheNews === "always") {
|
||||
await actuallyDoTheNews();
|
||||
} else if (state.settings.doTheNews === "while_live") {
|
||||
const transition = await broadcastApiRequest<{
|
||||
autoNews: boolean;
|
||||
selSource: number;
|
||||
switchAudioAtMin: number;
|
||||
}>("/nextTransition", "GET", {});
|
||||
if (transition.autoNews) {
|
||||
await actuallyDoTheNews();
|
||||
if (state.broadcast.connectionState === "CONNECTED" || state.broadcast.connectionState === "LIVE") {
|
||||
const transition = await broadcastApiRequest<{
|
||||
autoNews: boolean;
|
||||
selSource: number;
|
||||
switchAudioAtMin: number;
|
||||
}>("/nextTransition", "GET", {});
|
||||
if (transition.autoNews) {
|
||||
await actuallyDoTheNews();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue