Fix double-initial refresh

This commit is contained in:
Matthias 2021-09-01 20:34:01 +02:00
parent 0467a18649
commit d012e3166f

View File

@ -142,12 +142,12 @@ export default function createBotStore(store) {
selectBot({ commit }, botId: string) {
commit('selectBot', botId);
},
allRefreshFrequent({ dispatch, getters }) {
allRefreshFrequent({ dispatch, getters }, slow: boolean) {
console.log('dispatching all frequent refreshes');
getters.allAvailableBotsList.forEach((e) => {
if (getters[`${e}/${BotStoreGetters.autoRefresh}`]) {
console.log('refreshing ', e);
dispatch(`${e}/${BotStoreActions.refreshFrequent}`);
dispatch(`${e}/${BotStoreActions.refreshFrequent}`, slow);
}
});
},
@ -180,7 +180,7 @@ export default function createBotStore(store) {
startRefresh({ state, dispatch, commit }) {
console.log('Starting automatic refresh.');
dispatch('allRefreshFrequent');
dispatch('allRefreshFrequent', false);
if (!state.refreshInterval) {
// Set interval for refresh