update
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user