Validate if pairlist can be valid

This commit is contained in:
Matthias 2023-05-29 08:40:24 +02:00
parent 70f9033306
commit cf3d3001e5

View File

@ -46,7 +46,7 @@
@remove="removeFromConfig" @remove="removeFromConfig"
/> />
<b-button <b-button
:disabled="evaluating || config.pairlists.length == 0" :disabled="evaluating || !pairlistValid"
variant="primary" variant="primary"
size="lg" size="lg"
squared squared
@ -90,6 +90,18 @@ const pairlistConfigsEl = ref<HTMLElement | null>(null);
const availablePairlistsEl = ref<HTMLElement | null>(null); const availablePairlistsEl = ref<HTMLElement | null>(null);
const evaluating = ref(false); const evaluating = ref(false);
const firstPairlistIsGenerator = computed<boolean>(() => {
// First pairlist must be a generator
if (config.value.pairlists[0]?.is_pairlist_generator) {
return true;
}
return false;
});
const pairlistValid = computed<boolean>(() => {
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 // v-for updates with sorting, deleting and adding items seem to get wonky without unique keys for every item
const pairlistsComp = computed(() => const pairlistsComp = computed(() =>
config.value.pairlists.map((p) => { config.value.pairlists.map((p) => {