Improve refresh logic

This commit is contained in:
Matthias 2024-04-28 15:30:27 +02:00
parent 348cb8349b
commit 275bad172c
2 changed files with 16 additions and 7 deletions

View File

@ -217,7 +217,15 @@ watch(
() => botStore.activeBot.selectedPair,
() => {
botStore.activeBot.plotPair = botStore.activeBot.selectedPair;
refresh();
},
);
watch(
() => botStore.activeBot.plotPair,
() => {
if (!props.historicView) {
refresh();
}
},
);

View File

@ -380,13 +380,14 @@ export function createBotSubStore(botId: string, botName: string) {
console.error(err);
this.candleDataStatus = LoadingStatus.error;
}
} else {
// Error branch
const error = 'pair or timeframe not specified';
console.error(error);
return new Promise((resolve, reject) => {
reject(error);
});
}
// Error branchs
const error = 'pair or timeframe not specified';
console.error(error);
return new Promise((resolve, reject) => {
reject(error);
});
},
async getPairHistory(payload: PairHistoryPayload) {
if (payload.pair && payload.timeframe) {