mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Improve global refresh behavior
This commit is contained in:
parent
e2dc1b9b10
commit
1ba29e80fa
|
@ -10,7 +10,7 @@
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
size="sm"
|
size="sm"
|
||||||
title="Auto Refresh All bots"
|
title="Auto Refresh All bots"
|
||||||
@click="allRefreshFull(true)"
|
@click="allRefreshFull"
|
||||||
>
|
>
|
||||||
<RefreshIcon :size="16" />
|
<RefreshIcon :size="16" />
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|
|
@ -235,14 +235,14 @@ export default function createBotStore(store) {
|
||||||
setGlobalAutoRefresh({ commit }, value: boolean) {
|
setGlobalAutoRefresh({ commit }, value: boolean) {
|
||||||
commit('setGlobalAutoRefresh', value);
|
commit('setGlobalAutoRefresh', value);
|
||||||
},
|
},
|
||||||
allRefreshFrequent({ dispatch, getters }, slow: boolean) {
|
allRefreshFrequent({ dispatch, getters }, forceUpdate = false) {
|
||||||
getters.allAvailableBotsList.forEach((e) => {
|
getters.allAvailableBotsList.forEach((e) => {
|
||||||
if (
|
if (
|
||||||
getters[`${e}/${BotStoreGetters.refreshNow}`] &&
|
getters[`${e}/${BotStoreGetters.refreshNow}`] &&
|
||||||
getters[MultiBotStoreGetters.globalAutoRefresh]
|
(getters[MultiBotStoreGetters.globalAutoRefresh] || forceUpdate)
|
||||||
) {
|
) {
|
||||||
// console.log('refreshing', e);
|
// console.log('refreshing', e);
|
||||||
dispatch(`${e}/${BotStoreActions.refreshFrequent}`, slow);
|
dispatch(`${e}/${BotStoreActions.refreshFrequent}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -250,13 +250,13 @@ export default function createBotStore(store) {
|
||||||
getters.allAvailableBotsList.forEach((e) => {
|
getters.allAvailableBotsList.forEach((e) => {
|
||||||
if (
|
if (
|
||||||
getters[`${e}/${BotStoreGetters.refreshNow}`] &&
|
getters[`${e}/${BotStoreGetters.refreshNow}`] &&
|
||||||
getters[MultiBotStoreGetters.globalAutoRefresh]
|
(getters[MultiBotStoreGetters.globalAutoRefresh] || forceUpdate)
|
||||||
) {
|
) {
|
||||||
dispatch(`${e}/${BotStoreActions.refreshSlow}`, forceUpdate);
|
dispatch(`${e}/${BotStoreActions.refreshSlow}`, forceUpdate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async allRefreshFull({ commit, dispatch, state }, forceUpdate = false) {
|
async allRefreshFull({ commit, dispatch, state }) {
|
||||||
if (state.refreshing) {
|
if (state.refreshing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,10 +479,7 @@ export function createBotSubStore(botId: string, botName: string) {
|
||||||
dispatch('setRefreshRequired', false);
|
dispatch('setRefreshRequired', false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[BotStoreActions.refreshFrequent]({ dispatch }, slow = true) {
|
[BotStoreActions.refreshFrequent]({ dispatch }) {
|
||||||
if (slow) {
|
|
||||||
dispatch('refreshSlow', false);
|
|
||||||
}
|
|
||||||
// Refresh data that's needed in near realtime
|
// Refresh data that's needed in near realtime
|
||||||
dispatch('getOpenTrades');
|
dispatch('getOpenTrades');
|
||||||
dispatch('getState');
|
dispatch('getState');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user