Properly handle dashboard startup

This commit is contained in:
Matthias 2022-05-12 19:25:01 +02:00
parent 3bf4eb94c6
commit ccfa81b051
2 changed files with 17 additions and 14 deletions

View File

@ -205,6 +205,7 @@ export function createBotSubStore(botId: string, botName: string) {
} }
// Refresh data only when needed // Refresh data only when needed
if (forceUpdate || this.refreshRequired) { if (forceUpdate || this.refreshRequired) {
try {
this.refreshing = true; this.refreshing = true;
// TODO: Should be AxiosInstance // TODO: Should be AxiosInstance
const updates: Promise<any>[] = []; const updates: Promise<any>[] = [];
@ -217,8 +218,10 @@ export function createBotSubStore(botId: string, botName: string) {
updates.push(this.getBlacklist()); updates.push(this.getBlacklist());
await Promise.all(updates); await Promise.all(updates);
this.refreshRequired = false; this.refreshRequired = false;
} finally {
this.refreshing = false; this.refreshing = false;
} }
}
return Promise.resolve(); return Promise.resolve();
}, },
async refreshFrequent() { async refreshFrequent() {

View File

@ -183,7 +183,7 @@ export default defineComponent({
onMounted(async () => { onMounted(async () => {
await botStore.allGetDaily({ timescale: 30 }); await botStore.allGetDaily({ timescale: 30 });
botStore.activeBot.getTrades(); // botStore.activeBot.getTrades();
botStore.activeBot.getOpenTrades(); botStore.activeBot.getOpenTrades();
botStore.activeBot.getProfit(); botStore.activeBot.getProfit();
}); });