mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Fix loading of refresh setting
This commit is contained in:
parent
be4b90f5a3
commit
0467a18649
|
@ -111,7 +111,7 @@ export default function createBotStore(store) {
|
|||
|
||||
const actions = {
|
||||
// Actions automatically filled below
|
||||
addBot({ getters, commit }, bot: BotDescriptor) {
|
||||
addBot({ dispatch, getters, commit }, bot: BotDescriptor) {
|
||||
if (Object.keys(getters.allAvailableBots).includes(bot.botId)) {
|
||||
// throw 'Bot already present';
|
||||
// TODO: handle error!
|
||||
|
@ -120,6 +120,7 @@ export default function createBotStore(store) {
|
|||
}
|
||||
console.log('add bot', bot);
|
||||
store.registerModule(['ftbot', bot.botId], createBotSubStore(bot.botId));
|
||||
dispatch(`${bot.botId}/botAdded`);
|
||||
commit('addBot', bot);
|
||||
},
|
||||
removeBot({ commit, getters, dispatch }, botId: string) {
|
||||
|
|
|
@ -93,6 +93,7 @@ export enum BotStoreGetters {
|
|||
}
|
||||
|
||||
export enum BotStoreActions {
|
||||
botAdded = 'botAdded',
|
||||
ping = 'ping',
|
||||
setIsBotOnline = 'setIsBotOnline',
|
||||
setAutoRefresh = 'setAutoRefresh',
|
||||
|
@ -142,7 +143,6 @@ export function createBotSubStore(botId: string) {
|
|||
const userService = useUserService(botId);
|
||||
const { api } = useApi(userService, botId);
|
||||
|
||||
|
||||
return {
|
||||
namespaced: true,
|
||||
state,
|
||||
|
@ -421,6 +421,9 @@ export function createBotSubStore(botId: string) {
|
|||
},
|
||||
},
|
||||
actions: {
|
||||
[BotStoreActions.botAdded]({ commit }) {
|
||||
commit('setAutoRefresh', userService.getAutoRefresh());
|
||||
},
|
||||
[BotStoreActions.ping]({ commit }) {
|
||||
api
|
||||
.get('/ping')
|
||||
|
|
Loading…
Reference in New Issue
Block a user