From cf3d3001e58cf04d2ee5c762da8b2e135559fb38 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 29 May 2023 08:40:24 +0200 Subject: [PATCH] Validate if pairlist can be valid --- src/components/ftbot/PairlistConfigurator.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/ftbot/PairlistConfigurator.vue b/src/components/ftbot/PairlistConfigurator.vue index 11ce146c..c7562261 100644 --- a/src/components/ftbot/PairlistConfigurator.vue +++ b/src/components/ftbot/PairlistConfigurator.vue @@ -46,7 +46,7 @@ @remove="removeFromConfig" /> (null); const availablePairlistsEl = ref(null); const evaluating = ref(false); +const firstPairlistIsGenerator = computed(() => { + // First pairlist must be a generator + if (config.value.pairlists[0]?.is_pairlist_generator) { + return true; + } + return false; +}); + +const pairlistValid = computed(() => { + return firstPairlistIsGenerator.value && config.value.pairlists.length > 0; +}); + // v-for updates with sorting, deleting and adding items seem to get wonky without unique keys for every item const pairlistsComp = computed(() => config.value.pairlists.map((p) => {