the_news: check if we're connected prior to asking for nextTransition

This commit is contained in:
Marks Polakovs 2020-05-10 11:03:04 +02:00
parent b11de69b0a
commit ebfde59120

View file

@ -51,6 +51,7 @@ 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 (state.broadcast.connectionState === "CONNECTED" || state.broadcast.connectionState === "LIVE") {
const transition = await broadcastApiRequest<{ const transition = await broadcastApiRequest<{
autoNews: boolean; autoNews: boolean;
selSource: number; selSource: number;
@ -60,6 +61,7 @@ const considerDoingTheNews = (getState: () => RootState) => async () => {
await actuallyDoTheNews(); await actuallyDoTheNews();
} }
} }
}
}; };
let newsTimer: Timer | null = null; let newsTimer: Timer | null = null;