From 8b7d79162d6c59fb05ed503963685ecc4b004e65 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 2 Sep 2021 06:57:48 +0200 Subject: [PATCH] Don't update if bot is offline --- src/store/modules/botStoreWrapper.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/store/modules/botStoreWrapper.ts b/src/store/modules/botStoreWrapper.ts index 32fa8a00..470894be 100644 --- a/src/store/modules/botStoreWrapper.ts +++ b/src/store/modules/botStoreWrapper.ts @@ -145,7 +145,10 @@ export default function createBotStore(store) { allRefreshFrequent({ dispatch, getters }, slow: boolean) { console.log('dispatching all frequent refreshes'); getters.allAvailableBotsList.forEach((e) => { - if (getters[`${e}/${BotStoreGetters.autoRefresh}`]) { + if ( + getters[`${e}/${BotStoreGetters.autoRefresh}`] && + getters[`${e}/${BotStoreGetters.isBotOnline}`] + ) { // console.log('refreshing', e); dispatch(`${e}/${BotStoreActions.refreshFrequent}`, slow); } @@ -154,7 +157,10 @@ export default function createBotStore(store) { allRefreshSlow({ dispatch, getters }) { console.log('dispatching all slow refreshes'); getters.allAvailableBotsList.forEach((e) => { - if (getters[`${e}/${BotStoreGetters.autoRefresh}`]) { + if ( + getters[`${e}/${BotStoreGetters.autoRefresh}`] && + getters[`${e}/${BotStoreGetters.isBotOnline}`] + ) { dispatch(`${e}/${BotStoreActions.refreshSlow}`); } });