Fix: don't show radiobuttons if only one option is available

This commit is contained in:
Pieter Vander Vennet 2023-05-05 00:42:58 +02:00
parent e34e39d20f
commit 8e68ca03ab

View file

@ -37,7 +37,12 @@
let selectedMapping: number = undefined;
let checkedMappings: boolean[];
$: {
mappings = config.mappings
mappings = config.mappings?.filter(m => {
if(typeof m.hideInAnswer === "boolean"){
return !m.hideInAnswer
}
return m.hideInAnswer.matchesProperties(tags.data)
})
// We received a new config -> reinit
console.log("Initing checkedMappings for", config)
if (config.mappings?.length > 0 && (checkedMappings === undefined || checkedMappings?.length < config.mappings.length)) {