mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 03:25:15 +00:00
Improve handling of empty pair-data responses
This commit is contained in:
parent
c3c21f5a36
commit
a03f1bb917
|
@ -132,7 +132,7 @@ const dataset = computed((): PairHistory => {
|
||||||
});
|
});
|
||||||
const strategyName = computed(() => props.strategy || dataset.value?.strategy || '');
|
const strategyName = computed(() => props.strategy || dataset.value?.strategy || '');
|
||||||
const datasetColumns = computed(() => (dataset.value ? dataset.value.columns : []));
|
const datasetColumns = computed(() => (dataset.value ? dataset.value.columns : []));
|
||||||
const hasDataset = computed(() => !!dataset.value);
|
const hasDataset = computed(() => dataset.value && dataset.value.data.length > 0);
|
||||||
const isLoadingDataset = computed((): boolean => {
|
const isLoadingDataset = computed((): boolean => {
|
||||||
if (props.historicView) {
|
if (props.historicView) {
|
||||||
return botStore.activeBot.historyStatus === LoadingStatus.loading;
|
return botStore.activeBot.historyStatus === LoadingStatus.loading;
|
||||||
|
|
|
@ -340,7 +340,7 @@ export function createBotSubStore(botId: string, botName: string) {
|
||||||
},
|
},
|
||||||
getPairCandles(payload: PairCandlePayload) {
|
getPairCandles(payload: PairCandlePayload) {
|
||||||
if (payload.pair && payload.timeframe) {
|
if (payload.pair && payload.timeframe) {
|
||||||
this.historyStatus = LoadingStatus.loading;
|
this.candleDataStatus = LoadingStatus.loading;
|
||||||
return api
|
return api
|
||||||
.get('/pair_candles', {
|
.get('/pair_candles', {
|
||||||
params: { ...payload },
|
params: { ...payload },
|
||||||
|
@ -354,11 +354,11 @@ export function createBotSubStore(botId: string, botName: string) {
|
||||||
data: result.data,
|
data: result.data,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
this.historyStatus = LoadingStatus.success;
|
this.candleDataStatus = LoadingStatus.success;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this.historyStatus = LoadingStatus.error;
|
this.candleDataStatus = LoadingStatus.error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Error branchs
|
// Error branchs
|
||||||
|
|
Loading…
Reference in New Issue
Block a user