This commit is contained in:
Team3
2026-06-07 10:17:21 +02:00
parent 1d44fcd891
commit 6743b1234e
2 changed files with 15 additions and 15 deletions

View File

@@ -128,20 +128,19 @@ function handleFormatClick(format) {
}
}
// Lernschulden-Regel: max. 5 erstellte, aber nicht absolvierte Guides —
// Lernschulden-Regel: JE Format max. 5 erstellte, aber nicht absolvierte Guides —
// darüber sind nur Neu-Generierungen bereits erstellter Guides erlaubt.
const offeneGuides = computed(() => {
const f = props.stats?.formate || {}
return ['MiniGuide', 'Guide', 'FullGuide'].reduce(
(sum, k) => sum + ((f[k]?.erstellt ?? 0) - (f[k]?.absolviert ?? 0)), 0,
)
})
function offeneGuides(format) {
const f = props.stats?.formate?.[format]
return (f?.erstellt ?? 0) - (f?.absolviert ?? 0)
}
function playLock(format) {
if (format === 'OnePager') return null
if (!props.bausteine.ready) return 'Erst Bausteine erstellen'
if (offeneGuides.value >= 5 && !props.doneByFormat[format]) {
return `Erst Guides absolvieren — ${offeneGuides.value} offen (max. 5)`
const offen = offeneGuides(format)
if (offen >= 5 && !props.doneByFormat[format]) {
return `Erst ${format}s absolvieren — ${offen} offen (max. 5)`
}
return null
}