mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 18:23:50 +00:00
Properly handle dashboard startup
This commit is contained in:
parent
3bf4eb94c6
commit
ccfa81b051
|
@ -205,19 +205,22 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
}
|
||||
// Refresh data only when needed
|
||||
if (forceUpdate || this.refreshRequired) {
|
||||
this.refreshing = true;
|
||||
// TODO: Should be AxiosInstance
|
||||
const updates: Promise<any>[] = [];
|
||||
updates.push(this.getPerformance());
|
||||
updates.push(this.getProfit());
|
||||
updates.push(this.getTrades());
|
||||
updates.push(this.getBalance());
|
||||
// /* white/blacklist might be refreshed more often as they are not expensive on the backend */
|
||||
updates.push(this.getWhitelist());
|
||||
updates.push(this.getBlacklist());
|
||||
await Promise.all(updates);
|
||||
this.refreshRequired = false;
|
||||
this.refreshing = false;
|
||||
try {
|
||||
this.refreshing = true;
|
||||
// TODO: Should be AxiosInstance
|
||||
const updates: Promise<any>[] = [];
|
||||
updates.push(this.getPerformance());
|
||||
updates.push(this.getProfit());
|
||||
updates.push(this.getTrades());
|
||||
updates.push(this.getBalance());
|
||||
// /* white/blacklist might be refreshed more often as they are not expensive on the backend */
|
||||
updates.push(this.getWhitelist());
|
||||
updates.push(this.getBlacklist());
|
||||
await Promise.all(updates);
|
||||
this.refreshRequired = false;
|
||||
} finally {
|
||||
this.refreshing = false;
|
||||
}
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
|
|
@ -183,7 +183,7 @@ export default defineComponent({
|
|||
|
||||
onMounted(async () => {
|
||||
await botStore.allGetDaily({ timescale: 30 });
|
||||
botStore.activeBot.getTrades();
|
||||
// botStore.activeBot.getTrades();
|
||||
botStore.activeBot.getOpenTrades();
|
||||
botStore.activeBot.getProfit();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user