mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 18:23:50 +00:00
Don't sync twice on startup
This commit is contained in:
parent
2af9aeb28a
commit
3bc285ec7b
|
@ -33,7 +33,7 @@ export default class ReloadControl extends Vue {
|
|||
}
|
||||
|
||||
mounted() {
|
||||
this.startRefresh();
|
||||
this.startRefresh(false);
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
|
@ -63,19 +63,23 @@ export default class ReloadControl extends Vue {
|
|||
this.setAutoRefresh(newValue);
|
||||
}
|
||||
|
||||
startRefresh() {
|
||||
startRefresh(runNow: boolean) {
|
||||
if (this.loggedIn !== true) {
|
||||
console.log('Not logged in.');
|
||||
return;
|
||||
}
|
||||
console.log('Starting automatic refresh.');
|
||||
this.refreshFrequent();
|
||||
if (runNow) {
|
||||
this.refreshFrequent(false);
|
||||
}
|
||||
if (this.autoRefresh) {
|
||||
this.refreshInterval = window.setInterval(() => {
|
||||
this.refreshFrequent();
|
||||
}, 5000);
|
||||
}
|
||||
this.refreshSlow(true);
|
||||
if (runNow) {
|
||||
this.refreshSlow(true);
|
||||
}
|
||||
if (this.autoRefresh) {
|
||||
this.refreshIntervalSlow = window.setInterval(() => {
|
||||
this.refreshSlow(false);
|
||||
|
@ -96,7 +100,7 @@ export default class ReloadControl extends Vue {
|
|||
@Watch('autoRefresh')
|
||||
watchAutoRefresh(val) {
|
||||
if (val) {
|
||||
this.startRefresh();
|
||||
this.startRefresh(true);
|
||||
} else {
|
||||
this.stopRefresh();
|
||||
}
|
||||
|
|
|
@ -117,8 +117,10 @@ export default new Vuex.Store({
|
|||
commit('ftbot/updateRefreshRequired', false);
|
||||
}
|
||||
},
|
||||
refreshFrequent({ dispatch }) {
|
||||
dispatch('refreshSlow', false);
|
||||
refreshFrequent({ dispatch }, slow = true) {
|
||||
if (slow) {
|
||||
dispatch('refreshSlow', false);
|
||||
}
|
||||
// Refresh data that's needed in near realtime
|
||||
dispatch('ftbot/getOpenTrades');
|
||||
dispatch('ftbot/getState');
|
||||
|
|
Loading…
Reference in New Issue
Block a user