Don't update if bot is offline

This commit is contained in:
Matthias 2021-09-02 06:57:48 +02:00
parent 3df41fdc68
commit 8b7d79162d

View File

@ -145,7 +145,10 @@ export default function createBotStore(store) {
allRefreshFrequent({ dispatch, getters }, slow: boolean) { allRefreshFrequent({ dispatch, getters }, slow: boolean) {
console.log('dispatching all frequent refreshes'); console.log('dispatching all frequent refreshes');
getters.allAvailableBotsList.forEach((e) => { getters.allAvailableBotsList.forEach((e) => {
if (getters[`${e}/${BotStoreGetters.autoRefresh}`]) { if (
getters[`${e}/${BotStoreGetters.autoRefresh}`] &&
getters[`${e}/${BotStoreGetters.isBotOnline}`]
) {
// console.log('refreshing', e); // console.log('refreshing', e);
dispatch(`${e}/${BotStoreActions.refreshFrequent}`, slow); dispatch(`${e}/${BotStoreActions.refreshFrequent}`, slow);
} }
@ -154,7 +157,10 @@ export default function createBotStore(store) {
allRefreshSlow({ dispatch, getters }) { allRefreshSlow({ dispatch, getters }) {
console.log('dispatching all slow refreshes'); console.log('dispatching all slow refreshes');
getters.allAvailableBotsList.forEach((e) => { getters.allAvailableBotsList.forEach((e) => {
if (getters[`${e}/${BotStoreGetters.autoRefresh}`]) { if (
getters[`${e}/${BotStoreGetters.autoRefresh}`] &&
getters[`${e}/${BotStoreGetters.isBotOnline}`]
) {
dispatch(`${e}/${BotStoreActions.refreshSlow}`); dispatch(`${e}/${BotStoreActions.refreshSlow}`);
} }
}); });