Fix cumProfitChart being empty

part of #879
This commit is contained in:
Matthias 2022-07-30 07:09:48 +02:00
parent 5d94fe5f9c
commit 20d3b80d41

View File

@ -52,9 +52,8 @@ export default defineComponent({
const botList = ref<string[]>([]);
const cumulativeData = ref<{ date: number; profit: any }[]>([]);
watch(
() => props.trades,
() => {
const calcCumulativeData = () => {
console.log('trades');
botList.value = [];
const res: CumProfitData[] = [];
const resD: CumProfitDataPerDate = {};
@ -97,8 +96,10 @@ export default defineComponent({
// });
return obj;
});
},
);
};
watch([props.trades], calcCumulativeData);
// Initial call
calcCumulativeData();
const chartOptions = computed((): EChartsOption => {
const chartOptionsLoc: EChartsOption = {