mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Start refresh from within store
This commit is contained in:
parent
d012e3166f
commit
3df41fdc68
|
@ -4,13 +4,13 @@
|
|||
<RefreshIcon :size="16" />
|
||||
</b-button>
|
||||
|
||||
<b-form-checkbox
|
||||
<!-- <b-form-checkbox
|
||||
v-model="autoRefreshLoc"
|
||||
class="ml-auto float-right mr-2 my-auto"
|
||||
title="AutoRefresh"
|
||||
variant="secondary"
|
||||
>AutoRefresh</b-form-checkbox
|
||||
>
|
||||
> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -28,18 +28,18 @@ export default class ReloadControl extends Vue {
|
|||
refreshIntervalSlow: number | null = null;
|
||||
|
||||
created() {
|
||||
if (this.loggedIn) {
|
||||
this.refreshOnce();
|
||||
this.refreshFull(true);
|
||||
}
|
||||
// if (this.loggedIn) {
|
||||
// this.refreshOnce();
|
||||
// this.refreshFull(true);
|
||||
// }
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.startRefresh(false);
|
||||
// this.startRefresh(false);
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
this.stopRefresh();
|
||||
// this.stopRefresh();
|
||||
}
|
||||
|
||||
// TODO-multi: This should be per bot!
|
||||
|
|
|
@ -77,4 +77,5 @@ Object.entries(UserService.getAvailableBots()).forEach(([k, v]) => {
|
|||
store.dispatch('ftbot/addBot', v);
|
||||
});
|
||||
store.dispatch('ftbot/selectFirstBot');
|
||||
store.dispatch('ftbot/startRefresh');
|
||||
export default store;
|
||||
|
|
|
@ -146,7 +146,7 @@ export default function createBotStore(store) {
|
|||
console.log('dispatching all frequent refreshes');
|
||||
getters.allAvailableBotsList.forEach((e) => {
|
||||
if (getters[`${e}/${BotStoreGetters.autoRefresh}`]) {
|
||||
console.log('refreshing ', e);
|
||||
// console.log('refreshing', e);
|
||||
dispatch(`${e}/${BotStoreActions.refreshFrequent}`, slow);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -424,14 +424,14 @@ export function createBotSubStore(botId: string) {
|
|||
[BotStoreActions.botAdded]({ commit }) {
|
||||
commit('setAutoRefresh', userService.getAutoRefresh());
|
||||
},
|
||||
[BotStoreActions.ping]({ commit }) {
|
||||
api
|
||||
.get('/ping')
|
||||
.then((result) => {
|
||||
commit('setPing', result.data);
|
||||
commit('setIsBotOnline', true);
|
||||
})
|
||||
.catch(console.error);
|
||||
async [BotStoreActions.ping]({ commit }) {
|
||||
try {
|
||||
const result = await api.get('/ping');
|
||||
commit('setPing', result.data);
|
||||
commit('setIsBotOnline', true);
|
||||
} catch (error) {
|
||||
//
|
||||
}
|
||||
},
|
||||
[BotStoreActions.logout]() {
|
||||
userService.logout();
|
||||
|
|
Loading…
Reference in New Issue
Block a user