Trigger candle reload if plotconfig changes in "reduced" mode

This commit is contained in:
Matthias 2024-04-28 15:46:13 +02:00
parent f9355790c8
commit d51246d1d1
2 changed files with 15 additions and 2 deletions

View File

@ -229,6 +229,18 @@ watch(
}, },
); );
watch(
() => plotStore.plotConfig,
() => {
// all plotstore.usedColumns are in the dataset
const hasAllColumns = plotStore.usedColumns.every((c) => datasetColumns.value.includes(c));
if (!props.historicView && settingsStore.useReducedPairCalls && !hasAllColumns) {
console.log('triggering refresh');
refresh();
}
},
);
onMounted(() => { onMounted(() => {
showPlotConfig.value = props.plotConfigModal; showPlotConfig.value = props.plotConfigModal;
if (botStore.activeBot.selectedPair) { if (botStore.activeBot.selectedPair) {

View File

@ -352,7 +352,8 @@ export function createBotSubStore(botId: string, botName: string) {
this.candleDataStatus = LoadingStatus.loading; this.candleDataStatus = LoadingStatus.loading;
try { try {
let result: PairHistory | null = null; let result: PairHistory | null = null;
if (this.botApiVersion >= 2.35) { const settingsStore = useSettingsStore();
if (this.botApiVersion >= 2.35 && settingsStore.useReducedPairCalls) {
// Modern approach, allowing filtering of columns // Modern approach, allowing filtering of columns
const { data } = await api.post<PairCandlePayload, AxiosResponse<PairHistory>>( const { data } = await api.post<PairCandlePayload, AxiosResponse<PairHistory>>(
'/pair_candles', '/pair_candles',
@ -381,7 +382,7 @@ export function createBotSubStore(botId: string, botName: string) {
this.candleDataStatus = LoadingStatus.error; this.candleDataStatus = LoadingStatus.error;
} }
} else { } else {
// Error branch // Error branchs
const error = 'pair or timeframe not specified'; const error = 'pair or timeframe not specified';
console.error(error); console.error(error);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {